diff --git a/binaries/puttycac-0.78u1-installer.msi b/binaries/puttycac-0.78u1-installer.msi
deleted file mode 100644
index 9d3147c6..00000000
Binary files a/binaries/puttycac-0.78u1-installer.msi and /dev/null differ
diff --git a/binaries/puttycac-0.78u1.zip b/binaries/puttycac-0.78u1.zip
deleted file mode 100644
index ea5d7ccf..00000000
Binary files a/binaries/puttycac-0.78u1.zip and /dev/null differ
diff --git a/binaries/puttycac-0.79-installer.msi b/binaries/puttycac-0.79-installer.msi
new file mode 100644
index 00000000..5df07400
Binary files /dev/null and b/binaries/puttycac-0.79-installer.msi differ
diff --git a/binaries/puttycac-0.79.zip b/binaries/puttycac-0.79.zip
new file mode 100644
index 00000000..f013db3a
Binary files /dev/null and b/binaries/puttycac-0.79.zip differ
diff --git a/binaries/puttycac-64bit-0.78u1-installer.msi b/binaries/puttycac-64bit-0.78u1-installer.msi
deleted file mode 100644
index 7c001073..00000000
Binary files a/binaries/puttycac-64bit-0.78u1-installer.msi and /dev/null differ
diff --git a/binaries/puttycac-64bit-0.78u1.zip b/binaries/puttycac-64bit-0.78u1.zip
deleted file mode 100644
index 9cb468d6..00000000
Binary files a/binaries/puttycac-64bit-0.78u1.zip and /dev/null differ
diff --git a/binaries/puttycac-64bit-0.79-installer.msi b/binaries/puttycac-64bit-0.79-installer.msi
new file mode 100644
index 00000000..f8db665f
Binary files /dev/null and b/binaries/puttycac-64bit-0.79-installer.msi differ
diff --git a/binaries/puttycac-64bit-0.79.zip b/binaries/puttycac-64bit-0.79.zip
new file mode 100644
index 00000000..07b89695
Binary files /dev/null and b/binaries/puttycac-64bit-0.79.zip differ
diff --git a/binaries/puttycac-hash.txt b/binaries/puttycac-hash.txt
index 82db81cc..47e692e6 100644
--- a/binaries/puttycac-hash.txt
+++ b/binaries/puttycac-hash.txt
@@ -1,81 +1,81 @@
Algorithm Hash Path
--------- ---- ----
-SHA256 F79CD0172951D67421AF0A410260E915BF6DD661DEFFC90E11A265B1BE26AEC6 x64\pageant.exe
-SHA256 6D5C37B020BDF51BA4300CC4CACCC8854EDD55644578DB169997066BC2F5E7EC x64\plink.exe
-SHA256 6CC7C669A49007E8EF38799004C98449A55582BFBE85C1D1DF62C4AD3C11D203 x64\pscp.exe
-SHA256 64B524C839C9159F280CBBD08C37C8AEC9AF8B638B42501D60492FC464D01CD6 x64\psftp.exe
-SHA256 7402E99518E6DB3C206375093212EFCEA4C052DA1ED5BE3BEC5181819AE20750 x64\pterm.exe
-SHA256 23CAFBCBD2FAC1241EBD9440539812DE3A6214D531D7DD1159CD8C5A2C5A885B x64\putty.exe
-SHA256 64557833E0A44BABC583B919E959FAA43DA0FB6D9BCE8796563AFE4382BA78C2 x64\puttygen.exe
-SHA256 00561D4083055A5903EDE95527A591555EF089EF1DEA9F1633E234831DA7DD78 x64\puttyimp.exe
-SHA256 B43D3D830CABBF79EFE38745BFFF8C9438465A7886E05289632DD36125EC4055 x64\puttytel.exe
-SHA256 DF4F73A2794B5ABDFCD94A031E546F0E771CA8CB19FBFB7A59BAE82D7B97A2A5 x86\pageant.exe
-SHA256 EB724F668B9480AD0C24ECA566B0F84143DF481FFEAEC7C186442BE76068A042 x86\plink.exe
-SHA256 46940E760C86DDACB4BB74BB7CD8768CAB8CCBC78B7A03A21ABD2E57473A2DB0 x86\pscp.exe
-SHA256 02ECD04BC96432C32FA4E7CF15FA62102132DCF65709CBCBB74EBD3CC3C4EE43 x86\psftp.exe
-SHA256 399AF4959745C71D32DE7FA252F497797E35F0BA3AD2F20B2357D08E5F078F6E x86\pterm.exe
-SHA256 1CCC2910A70E576F141A483B756D01B35EFA4F77CC1EF4B3EFF656237E8595B1 x86\putty.exe
-SHA256 550CD8F50A30D74683E60BF8BBCBC6A3C7789EC87111AFB07882D3E9C1F59D33 x86\puttygen.exe
-SHA256 200468EFB5481FC0777E68774E93F337A2E94D3604C43E44A42B1DEF17D09FF9 x86\puttyimp.exe
-SHA256 39E4F9A0B7E39B2F15186678944EEA5A93E9BC0E904C01220ACF1F725B8142A4 x86\puttytel.exe
-SHA256 C8DF457BE4AD9D3F078BE01A6A6272A641DF57B845474B899ED5B0AD5E6AC930 puttycac-0.78u1-installer.msi
-SHA256 75F1315888F89404B3EF18A8F2E459AB0A508027DF357E007E3A29EB8C31C242 puttycac-0.78u1.zip
-SHA256 C2E35BD6619EF090C983BE644FC606B858083B5A47CF03852A843B3ECFEBC18D puttycac-64bit-0.78u1-installer.msi
-SHA256 23A5445F9D3AE199C826B71B3B822AB30204741239FB1F8DF40AE2748DB91653 puttycac-64bit-0.78u1.zip
+SHA256 7ECB25837B73A77F9F499B3A678A178F465C3E9ED977626E4F4D8CCF1862D671 x64\pageant.exe
+SHA256 8F8CF52B97A1E12F7BE5C341B2B36AAAF633C242C028CE3FBC89562601DA21C9 x64\plink.exe
+SHA256 4EC816777E9F4663CE560C774E12A12C3527030FE6DA194D18A0A6517C5343C8 x64\pscp.exe
+SHA256 452D678ADE5A87F905318E0A349AB7FDD11C3FA23B4F0FE2731A18E1BCD1245F x64\psftp.exe
+SHA256 149A5EB061AADF75B7620631D515AEC61ECCA1623F2A4077B752F3C97DCD7FBA x64\pterm.exe
+SHA256 8BD28EFC5AB76CE59F351F5F465ADCC953209D4B12D8E378D715F29D3466C10C x64\putty.exe
+SHA256 62A955FAD1EDD02D82D6EF2D546EB83DF636BBADC06129B175EE831CDCFB3498 x64\puttygen.exe
+SHA256 2BE375E0285DB3E7E99E1724E7FEF9DA27F05F8B39F1DCF3938F9C75FB1A595D x64\puttyimp.exe
+SHA256 7AEF2277D864D7968D171EDC44156534DF8E3ADD7FE0B616DD5889D643F4E329 x64\puttytel.exe
+SHA256 6999A9F716AF727AD1B81A3FBCBBA9CA128501AABE8962CB0456391DC0478727 x86\pageant.exe
+SHA256 BA022E573F893C49312D1159791055FCC1DE9FA7BD230CA716D659D1D838DD66 x86\plink.exe
+SHA256 2418CEAEBE7A7392244FFCDA037E72F9FC986690863BD3DD2AB04A43A9A93BD6 x86\pscp.exe
+SHA256 25AF0BF568D17F50234C03FA0EB4E02488742CA0F4283502FABB831B49B01D96 x86\psftp.exe
+SHA256 40242E3222823E3D78E6F33742B5347AFE7FEDDC1B8031AC51DA562EF2D161D0 x86\pterm.exe
+SHA256 4CF9E917DDD9213EE769D474D92D0156D37BB66C4C60FA9CCA6F03A27C6FAEBB x86\putty.exe
+SHA256 7E9CEF25B0F828D26A9550281525048B5CF9A724883E887E9124A6003211F187 x86\puttygen.exe
+SHA256 2702563B4BFD89245043020197D9516A692AD01B167B9C4F7C3F848E011E9102 x86\puttyimp.exe
+SHA256 5CA6BD2003BA1EC355A22ACB2B4B01F6DB4AC9B0727976FE4D0D2B79B61F24FF x86\puttytel.exe
+SHA256 6A11D19193EB8E5D017C493247FE1CB324492255E8A0480BFC4558886C18AC57 puttycac-0.79-installer.msi
+SHA256 D12D57174BC59C17F06BDDD9DFDFFD1031E919F483F1D119200DD8750A4B49BF puttycac-0.79.zip
+SHA256 874C2383DB0A0B3E4B26B99148D9AD0110BBB77111645E3D9AA787BA52BE6590 puttycac-64bit-0.79-installer.msi
+SHA256 528A9FB537C49838D93680459BB91D7795598AC662EF62CCFB4EC47F3C686089 puttycac-64bit-0.79.zip
Algorithm Hash Path
--------- ---- ----
-SHA1 6B633F553D0A4A072E4BCD0D9A70B11F27E0173E x64\pageant.exe
-SHA1 C30660363CC33ECAD04F8BAE8465ABFAB1183C68 x64\plink.exe
-SHA1 64031302BD1C1B213EB1B37EDB5D79B93B93F7FA x64\pscp.exe
-SHA1 3F7C33BCDD3BBFA177536EB3117AFCE3751D5BFE x64\psftp.exe
-SHA1 562876A1DF37059BAC25B3A191DCB128EA25A4B1 x64\pterm.exe
-SHA1 CCDAB18EFAB32B3E20461C43E0FD55FC510CA6C8 x64\putty.exe
-SHA1 892875925403002C9F26A0922DCC1351502EE694 x64\puttygen.exe
-SHA1 EF7905FDBAD49457084BCE741345C74AFF7B8B23 x64\puttyimp.exe
-SHA1 380CF45A3D9E7D7FC93011F34F521C24B9A1EE38 x64\puttytel.exe
-SHA1 7FF488E651632BFE8D71AC51066D23EF8A84D99A x86\pageant.exe
-SHA1 FCFE60866B020A4323F10B5B762D70014B200C43 x86\plink.exe
-SHA1 D2D4756B8DB4EC4E1B9875C599E5510B5879621D x86\pscp.exe
-SHA1 3EAE6842EE11EEDB1B35FB958CF937063A276D39 x86\psftp.exe
-SHA1 EE2DAD8102A03EAF53D6B24F2D76A54FB238DF29 x86\pterm.exe
-SHA1 3C21F564BD80FC7BAC06B2179371C92A1EBF73EA x86\putty.exe
-SHA1 ABC1CA3D52BC6C0348597461CB43C1688312292F x86\puttygen.exe
-SHA1 4D3AAA5655D95C85AC6EF6DE110F3BC8F6BD1D3C x86\puttyimp.exe
-SHA1 2256A94F6C6BFC7C858F07764741B20844A11754 x86\puttytel.exe
-SHA1 BAD7C1A7DEF62F654808034D0C74ACE65D0CF765 puttycac-0.78u1-installer.msi
-SHA1 F9C2397D32639D7B9FB83FAE1B268F2D795916C8 puttycac-0.78u1.zip
-SHA1 5814D5308EF35A056BC2FE2ACF0AC9495144A52F puttycac-64bit-0.78u1-installer.msi
-SHA1 E07012AAEC96317BC277402CFAEAC6D7F0C03EF6 puttycac-64bit-0.78u1.zip
+SHA1 3DF29227FD929E23F9FBEDE9B831ED380892FEB9 x64\pageant.exe
+SHA1 ED9AC230317559581DDC22597156B137DAE566CE x64\plink.exe
+SHA1 46E7BBC3953AE92EB6331158652C2637851D35AC x64\pscp.exe
+SHA1 57A3900460E1CA9E8E83AF4140D36A2DC39F6FDF x64\psftp.exe
+SHA1 D99DC4E216CC1E6401674F46DC7B81F7D40BB3CC x64\pterm.exe
+SHA1 26DF7AABD714312E8FA0D08104E978CB6CA10733 x64\putty.exe
+SHA1 F5C6F303E3E5567386FCC170CA3531A4855025D8 x64\puttygen.exe
+SHA1 366A82861A856CCECEC6DD2C6CC3260EB99DA38A x64\puttyimp.exe
+SHA1 7A7F54B8CC38ED65213EEB818422CC60895B2E3B x64\puttytel.exe
+SHA1 C801DBB50198312869137C8A06C7D1237F1B480F x86\pageant.exe
+SHA1 07B1FE0351D7539610112A050CFB507B3247CC17 x86\plink.exe
+SHA1 52647F00B73A1BD9C9501CA6352AC066F77FA719 x86\pscp.exe
+SHA1 4B02BB575BA1546AB20C94CB179AB01E46455BD3 x86\psftp.exe
+SHA1 94B9924730557F8512CFD91402D71CFE359AE17E x86\pterm.exe
+SHA1 584525008C2959E1C0842234186D6C2CC4907D69 x86\putty.exe
+SHA1 50A7E211F164C35B35EB6A9F651A8B7DA6A7F84E x86\puttygen.exe
+SHA1 02E926581448AD1AB4FEE3503332D5C9FFA7C87E x86\puttyimp.exe
+SHA1 DA9530ED3B209FE3BA35708E75D904BB9EFF8F7A x86\puttytel.exe
+SHA1 3899AFDB6B0F0C959C672BF1A53404BD4E397FB7 puttycac-0.79-installer.msi
+SHA1 BBC476CF0BB72B1C6D4F32DB670DE2B2A16E6CFE puttycac-0.79.zip
+SHA1 C83013711564CBB2419C6F0E8F32623E0470E3DC puttycac-64bit-0.79-installer.msi
+SHA1 D101C8A9D2488E139AC8A385161834AB9DBEFDA2 puttycac-64bit-0.79.zip
Algorithm Hash Path
--------- ---- ----
-MD5 6CE055801AA78A16651DF994EA7FA989 x64\pageant.exe
-MD5 9AA88858A1E0480FF2F8AA53939E4EF3 x64\plink.exe
-MD5 CC4D6265A9D7DB05B9535C0C6C482F4A x64\pscp.exe
-MD5 88C393D3E45E760D23247A81FD42EA82 x64\psftp.exe
-MD5 635152540647A03106E5796739DA1336 x64\pterm.exe
-MD5 86CD921032BDE10210F7D51002645094 x64\putty.exe
-MD5 AAC9AADC2B5F0BCB056D14AF0092449F x64\puttygen.exe
-MD5 97A404FB06A16E7DDC1F62658820DB24 x64\puttyimp.exe
-MD5 30782E6E49099AFF0ED0C56E70FBFFFC x64\puttytel.exe
-MD5 D5F6049CFE46F5D810A88A8F15760CE1 x86\pageant.exe
-MD5 875E519BFB4DE85FAE1885BB62A1C2D1 x86\plink.exe
-MD5 127DA5975D805C4A8F73B59183A83F71 x86\pscp.exe
-MD5 12D14F087DC6247CDF532DD68CFFC2F1 x86\psftp.exe
-MD5 33372D25F64E2B2376BCAEB850907BAE x86\pterm.exe
-MD5 C9488632A4B1138F5B7F7357AFC1667C x86\putty.exe
-MD5 7F76007D31FFC003404066A38F80E62A x86\puttygen.exe
-MD5 ECD0E9B02B632B620C02DF81CB9BF20C x86\puttyimp.exe
-MD5 824DFA9ABA9BBC337E19DD57017891E6 x86\puttytel.exe
-MD5 651A006CD9652A674A501467C692521C puttycac-0.78u1-installer.msi
-MD5 3006E967CE669779DD55BAF6415B75C9 puttycac-0.78u1.zip
-MD5 64F936590343214418C715A6362CC913 puttycac-64bit-0.78u1-installer.msi
-MD5 4EE2EEEAF6DAB69E2AB5905408C202D1 puttycac-64bit-0.78u1.zip
+MD5 B42C43EE616270C167216FCCD5AB3C1A x64\pageant.exe
+MD5 943259D6CA1F43EC9FD4107E864F7F67 x64\plink.exe
+MD5 47D414E84376D792F5FB90B3F7AEA69F x64\pscp.exe
+MD5 5ABDAC194DC511DF508C230F3891142F x64\psftp.exe
+MD5 2ED85ACAA54B98D3087032B977BE172E x64\pterm.exe
+MD5 C4BFF08219279104390F78D8C7C7645E x64\putty.exe
+MD5 1AFE1BE7B086A4D6B3416CDF2C2D43ED x64\puttygen.exe
+MD5 47A029AE85BF804AB70317D041A166F5 x64\puttyimp.exe
+MD5 4CDC0D4684E56CD8DD128F0FF849363B x64\puttytel.exe
+MD5 FA155FFEF6897BAB56CAE8CEF97F7A82 x86\pageant.exe
+MD5 626B233FDCD5C057B673D43A0D4A18EE x86\plink.exe
+MD5 FFD5F73335169F090FD8A64685E70BA8 x86\pscp.exe
+MD5 6ED4E45FE3EE16951743720A195DEA7A x86\psftp.exe
+MD5 9A74535AA8DCA6C1E99BAF280B41C2BE x86\pterm.exe
+MD5 5A90291FF850F893CF146A4D84D16A19 x86\putty.exe
+MD5 BCAD1E4C81A2012CC53E4A5F0B52993C x86\puttygen.exe
+MD5 49A0E9E8C850FF1B50FAAA5906201EDE x86\puttyimp.exe
+MD5 5568D86EC0533465CF49E9DDC98D089D x86\puttytel.exe
+MD5 4FC491F22B2C5C6359616AD3F32C4DF0 puttycac-0.79-installer.msi
+MD5 ABD1937226978881B1A336923FDBEF45 puttycac-0.79.zip
+MD5 4CBA150DCA2FF1609EC248A30D2ED558 puttycac-64bit-0.79-installer.msi
+MD5 8C85D645193D51C056AEBA804ACD4C50 puttycac-64bit-0.79.zip
diff --git a/binaries/x64/pageant.exe b/binaries/x64/pageant.exe
index e0d0947d..afd26add 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 a5a21917..77a238d2 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 43232b7a..6bccd109 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 4f41affc..293812e7 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
index adba4bf7..602c6b5b 100644
Binary files a/binaries/x64/pterm.exe and b/binaries/x64/pterm.exe differ
diff --git a/binaries/x64/putty.exe b/binaries/x64/putty.exe
index c4a16b11..9b15e365 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 2a2d82a5..86f806b0 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
index f4eb5701..d8a5b450 100644
Binary files a/binaries/x64/puttyimp.exe and b/binaries/x64/puttyimp.exe differ
diff --git a/binaries/x64/puttytel.exe b/binaries/x64/puttytel.exe
index dfe73bf3..eb7b885a 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 0aecc665..e538a80a 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 15532dac..dab5386d 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 9cee94e0..f6f20ac7 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 49011c2a..01fa8c25 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
index 2b3eaaaa..be993777 100644
Binary files a/binaries/x86/pterm.exe and b/binaries/x86/pterm.exe differ
diff --git a/binaries/x86/putty.exe b/binaries/x86/putty.exe
index fe81ac14..395a823a 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 1966cbaa..59edc9b2 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
index af76a8e5..edb32dd6 100644
Binary files a/binaries/x86/puttyimp.exe and b/binaries/x86/puttyimp.exe differ
diff --git a/binaries/x86/puttytel.exe b/binaries/x86/puttytel.exe
index 3dd3a297..ea1989fe 100644
Binary files a/binaries/x86/puttytel.exe and b/binaries/x86/puttytel.exe differ
diff --git a/code/Buildscr b/code/Buildscr
index 02de6432..826ad321 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 18293 # update this at every release
+set Epoch 18595 # 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
@@ -270,12 +270,16 @@ 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/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
+# Make putty.zip in each Windows directory. We add the files one by
+# one, because 'zip' exits with a success status if it managed to add
+# _at least one_ of the input files, even if another didn't exist. So
+# doing them one at a time gets us proper error reporting.
+in putty/windows/deliver/buildold do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
+in putty/windows/deliver/build32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
+in putty/windows/deliver/build64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
+in putty/windows/deliver/abuild32 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
+in putty/windows/deliver/abuild64 do for file in *.exe ../../../../docbuild/putty.chm; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip -k -j putty.zip "$$file";; esac; done
+in docbuild/html do for file in *.html; do case "$$file" in puttytel.exe | pterm.exe) ;; *) zip puttydoc.zip "$$file";; esac; done
# Deliver the actual PuTTY release directory into a subdir `putty'.
deliver putty/windows/deliver/buildold/*.exe putty/w32old/$@
diff --git a/code/LICENCE b/code/LICENCE
index e90600eb..577526ed 100644
--- a/code/LICENCE
+++ b/code/LICENCE
@@ -1,4 +1,4 @@
-PuTTY CAC is copyright 1997-2022 Simon Tatham & Bryan Berns.
+PuTTY is copyright 1997-2023 Simon Tatham & Bryan Berns.
Portions copyright Robert de Bath, Joris van Rantwijk, Delian
Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas Barry,
diff --git a/code/cmake/cmake.h.in b/code/cmake/cmake.h.in
index 5ad32515..3882148b 100644
--- a/code/cmake/cmake.h.in
+++ b/code/cmake/cmake.h.in
@@ -1,6 +1,7 @@
#cmakedefine NO_IPV6
#cmakedefine NO_GSSAPI
#cmakedefine STATIC_GSSAPI
+#cmakedefine NO_SCROLLBACK_COMPRESSION
#cmakedefine NO_MULTIMON
diff --git a/code/cmake/setup.cmake b/code/cmake/setup.cmake
index 7a650771..d81d5a5c 100644
--- a/code/cmake/setup.cmake
+++ b/code/cmake/setup.cmake
@@ -15,6 +15,12 @@ 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(PUTTY_COMPRESS_SCROLLBACK ON
+ # This is always on in production versions of PuTTY, but downstreams
+ # of the code have been known to find it a better tradeoff to
+ # disable it. So there's a #ifdef in terminal.c, and a cmake option
+ # to enable that ifdef just in case it needs testing or debugging.
+ CACHE BOOL "Store terminal scrollback in compressed form")
set(STRICT OFF
CACHE BOOL "Enable extra compiler warnings and make them errors")
@@ -108,6 +114,9 @@ endif()
if(PUTTY_FUZZING)
add_compile_definitions(FUZZING)
endif()
+if(NOT PUTTY_COMPRESS_SCROLLBACK)
+ set(NO_SCROLLBACK_COMPRESSION ON)
+endif()
if(PUTTY_COVERAGE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage -g ")
endif()
diff --git a/code/config.c b/code/config.c
index da5c80b7..811a94be 100644
--- a/code/config.c
+++ b/code/config.c
@@ -3452,7 +3452,8 @@ void setup_config_box(struct controlbox *b, bool midsession,
FILTER_KEY_FILES, false, "Select private key file",
HELPCTX(ssh_auth_privkey),
conf_filesel_handler, I(CONF_keyfile));
- ctrl_filesel(s, "Certificate to use with the private key:", 'e',
+ ctrl_filesel(s, "Certificate to use with the private key "
+ "(optional):", 'e',
NULL, false, "Select certificate file",
HELPCTX(ssh_auth_cert),
conf_filesel_handler, I(CONF_detached_cert));
@@ -3708,6 +3709,10 @@ void setup_config_box(struct controlbox *b, bool midsession,
s = ctrl_getset(b, "Connection/SSH/More bugs", "main",
"Detection of known bugs in SSH servers");
+ ctrl_droplist(s, "Old RSA/SHA2 cert algorithm naming", 'l', 20,
+ HELPCTX(ssh_bugs_rsa_sha2_cert_userauth),
+ sshbug_handler,
+ I(CONF_sshbug_rsa_sha2_cert_userauth));
ctrl_droplist(s, "Requires padding on SSH-2 RSA signatures", 'p', 20,
HELPCTX(ssh_bugs_rsapad2),
sshbug_handler, I(CONF_sshbug_rsapad2));
diff --git a/code/contrib/authplugin-example.py b/code/contrib/authplugin-example.py
index 395bd2c8..5932ad1a 100644
--- a/code/contrib/authplugin-example.py
+++ b/code/contrib/authplugin-example.py
@@ -3,6 +3,8 @@
# This is a demonstration example of how to write a
# keyboard-interactive authentication helper plugin using PuTTY's
# protocol for involving it in SSH connection setup.
+# The protocol, and the purpose of an authentication plugin, is
+# fully documented in an appendix to the PuTTY manual.
import io
import os
@@ -134,7 +136,8 @@ def protocol():
hostname = rd_string_utf8(msg)
port = rd_uint32(msg)
username = rd_string_utf8(msg)
- print(f"Got hostname {hostname!r}, port {port!r}", file=sys.stderr)
+ print(f"Got hostname {hostname!r}, port {port!r}", file=sys.stderr,
+ flush=True)
# Decide which protocol version we're speaking.
version = min(their_version, our_max_version)
@@ -279,7 +282,7 @@ def protocol():
# Demonstration write to stderr, to prove that it shows up in PuTTY's
# Event Log.
-print("Hello from test plugin's stderr", file=sys.stderr)
+print("Hello from test plugin's stderr", file=sys.stderr, flush=True)
try:
protocol()
diff --git a/code/contrib/libfido2/include/cbor.h b/code/contrib/libfido2/include/cbor.h
index d490e6c5..f3860107 100644
--- a/code/contrib/libfido2/include/cbor.h
+++ b/code/contrib/libfido2/include/cbor.h
@@ -43,17 +43,17 @@ extern "C" {
* @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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t* cbor_load(
+ cbor_data source, size_t source_size, struct cbor_load_result* result);
-/** Deep copy of an item
+/** Take a 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
+ * @return **new** CBOR deep copy or `NULL` on failure.
*/
-CBOR_EXPORT cbor_item_t* cbor_copy(cbor_item_t* item);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t* cbor_copy(cbor_item_t* item);
#if CBOR_PRETTY_PRINTER
#include
diff --git a/code/contrib/libfido2/include/cbor/arrays.h b/code/contrib/libfido2/include/cbor/arrays.h
index 740e9b16..cc5a7c01 100644
--- a/code/contrib/libfido2/include/cbor/arrays.h
+++ b/code/contrib/libfido2/include/cbor/arrays.h
@@ -20,6 +20,7 @@ extern "C" {
* @param item[borrow] An array
* @return The number of members
*/
+_CBOR_NODISCARD
CBOR_EXPORT size_t cbor_array_size(const cbor_item_t* item);
/** Get the size of the allocated storage
@@ -27,6 +28,7 @@ CBOR_EXPORT size_t cbor_array_size(const cbor_item_t* item);
* @param item[borrow] An array
* @return The size of the allocated storage (number of items)
*/
+_CBOR_NODISCARD
CBOR_EXPORT size_t cbor_array_allocated(const cbor_item_t* item);
/** Get item by index
@@ -35,6 +37,7 @@ CBOR_EXPORT size_t cbor_array_allocated(const cbor_item_t* item);
* @param index The index
* @return **incref** The item, or `NULL` in case of boundary violation
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index);
/** Set item by index
@@ -47,6 +50,7 @@ CBOR_EXPORT cbor_item_t* cbor_array_get(const cbor_item_t* item, size_t index);
* @param index The index, first item is 0.
* @return true on success, false on allocation failure.
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_array_set(cbor_item_t* item, size_t index,
cbor_item_t* value);
@@ -59,6 +63,7 @@ CBOR_EXPORT bool cbor_array_set(cbor_item_t* item, size_t index,
* @param index The index, first item is 0.
* @return true on success, false on allocation failure.
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_array_replace(cbor_item_t* item, size_t index,
cbor_item_t* value);
@@ -67,6 +72,7 @@ CBOR_EXPORT bool cbor_array_replace(cbor_item_t* item, size_t index,
* @param item[borrow] An array
* @return Is the array definite?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_array_is_definite(const cbor_item_t* item);
/** Is the array indefinite?
@@ -74,6 +80,7 @@ CBOR_EXPORT bool cbor_array_is_definite(const cbor_item_t* item);
* @param item[borrow] An array
* @return Is the array indefinite?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_array_is_indefinite(const cbor_item_t* item);
/** Get the array contents
@@ -84,6 +91,7 @@ CBOR_EXPORT bool cbor_array_is_indefinite(const cbor_item_t* item);
* @param item[borrow] An array
* @return #cbor_array_size items
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_item_t** cbor_array_handle(const cbor_item_t* item);
/** Create new definite array
@@ -91,13 +99,15 @@ CBOR_EXPORT cbor_item_t** cbor_array_handle(const cbor_item_t* item);
* @param size Number of slots to preallocate
* @return **new** array or `NULL` upon malloc failure
*/
+_CBOR_NODISCARD
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();
+_CBOR_NODISCARD
+CBOR_EXPORT cbor_item_t* cbor_new_indefinite_array(void);
/** Append to the end
*
@@ -108,6 +118,7 @@ CBOR_EXPORT cbor_item_t* cbor_new_indefinite_array();
* @param pushee[incref] The item to push
* @return true on success, false on failure
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_array_push(cbor_item_t* array, cbor_item_t* pushee);
#ifdef __cplusplus
diff --git a/code/contrib/libfido2/include/cbor/bytestrings.h b/code/contrib/libfido2/include/cbor/bytestrings.h
index 1942896f..fecaee92 100644
--- a/code/contrib/libfido2/include/cbor/bytestrings.h
+++ b/code/contrib/libfido2/include/cbor/bytestrings.h
@@ -28,6 +28,7 @@ extern "C" {
* @param item[borrow] a definite bytestring
* @return length of the binary data. Zero if no chunk has been attached yet
*/
+_CBOR_NODISCARD
CBOR_EXPORT size_t cbor_bytestring_length(const cbor_item_t *item);
/** Is the byte string definite?
@@ -35,6 +36,7 @@ CBOR_EXPORT size_t cbor_bytestring_length(const cbor_item_t *item);
* @param item[borrow] a byte string
* @return Is the byte string definite?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_bytestring_is_definite(const cbor_item_t *item);
/** Is the byte string indefinite?
@@ -42,6 +44,7 @@ CBOR_EXPORT bool cbor_bytestring_is_definite(const cbor_item_t *item);
* @param item[borrow] a byte string
* @return Is the byte string indefinite?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_bytestring_is_indefinite(const cbor_item_t *item);
/** Get the handle to the binary data
@@ -53,6 +56,7 @@ CBOR_EXPORT bool cbor_bytestring_is_indefinite(const cbor_item_t *item);
* @return The address of the binary data. `NULL` if no data have been assigned
* yet.
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_mutable_data cbor_bytestring_handle(const cbor_item_t *item);
/** Set the handle to the binary data
@@ -74,6 +78,7 @@ CBOR_EXPORT void cbor_bytestring_set_handle(
* @param item[borrow] A indefinite byte string
* @return array of #cbor_bytestring_chunk_count definite bytestrings
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_item_t **cbor_bytestring_chunks_handle(
const cbor_item_t *item);
@@ -82,6 +87,7 @@ CBOR_EXPORT cbor_item_t **cbor_bytestring_chunks_handle(
* @param item[borrow] A indefinite bytestring
* @return The chunk count. 0 for freshly created items.
*/
+_CBOR_NODISCARD
CBOR_EXPORT size_t cbor_bytestring_chunk_count(const cbor_item_t *item);
/** Appends a chunk to the bytestring
@@ -95,6 +101,7 @@ CBOR_EXPORT size_t cbor_bytestring_chunk_count(const cbor_item_t *item);
* @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_NODISCARD
CBOR_EXPORT bool cbor_bytestring_add_chunk(cbor_item_t *item,
cbor_item_t *chunk);
@@ -104,7 +111,8 @@ CBOR_EXPORT bool cbor_bytestring_add_chunk(cbor_item_t *item,
*
* @return **new** definite bytestring. `NULL` on malloc failure.
*/
-CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring();
+_CBOR_NODISCARD
+CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring(void);
/** Creates a new indefinite byte string
*
@@ -112,7 +120,8 @@ CBOR_EXPORT cbor_item_t *cbor_new_definite_bytestring();
*
* @return **new** indefinite bytestring. `NULL` on malloc failure.
*/
-CBOR_EXPORT cbor_item_t *cbor_new_indefinite_bytestring();
+_CBOR_NODISCARD
+CBOR_EXPORT cbor_item_t *cbor_new_indefinite_bytestring(void);
/** Creates a new byte string and initializes it
*
@@ -123,6 +132,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_indefinite_bytestring();
* @return A **new** byte string with content `handle`. `NULL` on malloc
* failure.
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_item_t *cbor_build_bytestring(cbor_data handle, size_t length);
#ifdef __cplusplus
diff --git a/code/contrib/libfido2/include/cbor/common.h b/code/contrib/libfido2/include/cbor/common.h
index f4419e5e..48948c59 100644
--- a/code/contrib/libfido2/include/cbor/common.h
+++ b/code/contrib/libfido2/include/cbor/common.h
@@ -56,10 +56,24 @@ static const uint8_t cbor_patch_version = CBOR_PATCH_VERSION;
fprintf(stderr, "%s:%d:%s(): " fmt, __FILE__, __LINE__, __func__, \
__VA_ARGS__); \
} while (0)
+extern bool _cbor_enable_assert;
+// Like `assert`, but can be dynamically disabled in tests to allow testing
+// invalid behaviors.
+#define CBOR_ASSERT(e) assert(!_cbor_enable_assert || (e))
+#define _CBOR_TEST_DISABLE_ASSERT(block) \
+ do { \
+ _cbor_enable_assert = false; \
+ block _cbor_enable_assert = true; \
+ } while (0)
#else
#define debug_print(fmt, ...) \
do { \
} while (0)
+#define CBOR_ASSERT(e)
+#define _CBOR_TEST_DISABLE_ASSERT(block) \
+ do { \
+ block \
+ } while (0)
#endif
#define _CBOR_TO_STR_(x) #x
@@ -67,12 +81,25 @@ static const uint8_t cbor_patch_version = CBOR_PATCH_VERSION;
#ifdef __GNUC__
#define _CBOR_UNUSED(x) __attribute__((__unused__)) x
+// TODO(https://github.com/PJK/libcbor/issues/247): Prefer [[nodiscard]] if
+// available
+#define _CBOR_NODISCARD __attribute__((warn_unused_result))
#elif defined(_MSC_VER)
#define _CBOR_UNUSED(x) __pragma(warning(suppress : 4100 4101)) x
+#define _CBOR_NODISCARD
#else
#define _CBOR_UNUSED(x) x
+#define _CBOR_NODISCARD
#endif
+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;
+
// Macro to short-circuit builder functions when memory allocation fails
#define _CBOR_NOTNULL(cbor_item) \
do { \
@@ -85,24 +112,12 @@ static const uint8_t cbor_patch_version = CBOR_PATCH_VERSION;
#define _CBOR_DEPENDENT_NOTNULL(cbor_item, pointer) \
do { \
if (pointer == NULL) { \
- _CBOR_FREE(cbor_item); \
+ _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
@@ -123,18 +138,6 @@ 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
@@ -146,6 +149,7 @@ CBOR_EXPORT void cbor_set_allocs(_cbor_malloc_t custom_malloc,
* @param item[borrow]
* @return The type
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_type cbor_typeof(
const cbor_item_t *item); /* Will be inlined iff link-time opt is enabled */
@@ -155,48 +159,56 @@ CBOR_EXPORT cbor_type cbor_typeof(
* @param item[borrow] the item
* @return Is the item an #CBOR_TYPE_UINT?
*/
+_CBOR_NODISCARD
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_NODISCARD
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_NODISCARD
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_NODISCARD
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_NODISCARD
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_NODISCARD
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_NODISCARD
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_NODISCARD
CBOR_EXPORT bool cbor_isa_float_ctrl(const cbor_item_t *item);
/* Practical types with respect to their semantics (but not tag values) */
@@ -205,18 +217,21 @@ CBOR_EXPORT bool cbor_isa_float_ctrl(const cbor_item_t *item);
* @param item[borrow] the item
* @return Is the item an integer, either positive or negative?
*/
+_CBOR_NODISCARD
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_NODISCARD
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_NODISCARD
CBOR_EXPORT bool cbor_is_bool(const cbor_item_t *item);
/** Does this item represent `null`
@@ -229,6 +244,7 @@ CBOR_EXPORT bool cbor_is_bool(const cbor_item_t *item);
* @param item[borrow] the item
* @return Is the item (CBOR logical) null?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_is_null(const cbor_item_t *item);
/** Does this item represent `undefined`
@@ -241,6 +257,7 @@ CBOR_EXPORT bool cbor_is_null(const cbor_item_t *item);
* @param item[borrow] the item
* @return Is the item (CBOR logical) undefined?
*/
+_CBOR_NODISCARD
CBOR_EXPORT bool cbor_is_undef(const cbor_item_t *item);
/*
@@ -285,6 +302,7 @@ CBOR_EXPORT void cbor_intermediate_decref(cbor_item_t *item);
* @param item[borrow] the item
* @return the reference count
*/
+_CBOR_NODISCARD
CBOR_EXPORT size_t cbor_refcount(const cbor_item_t *item);
/** Provides CPP-like move construct
@@ -302,6 +320,7 @@ CBOR_EXPORT size_t cbor_refcount(const cbor_item_t *item);
* @param item[take] the item
* @return the item with reference count decreased by one
*/
+_CBOR_NODISCARD
CBOR_EXPORT cbor_item_t *cbor_move(cbor_item_t *item);
#ifdef __cplusplus
diff --git a/code/contrib/libfido2/include/cbor/configuration.h b/code/contrib/libfido2/include/cbor/configuration.h
index cf27a379..51ec90b2 100644
--- a/code/contrib/libfido2/include/cbor/configuration.h
+++ b/code/contrib/libfido2/include/cbor/configuration.h
@@ -2,10 +2,9 @@
#define LIBCBOR_CONFIGURATION_H
#define CBOR_MAJOR_VERSION 0
-#define CBOR_MINOR_VERSION 9
-#define CBOR_PATCH_VERSION 0
+#define CBOR_MINOR_VERSION 10
+#define CBOR_PATCH_VERSION 1
-#define CBOR_CUSTOM_ALLOC 0
#define CBOR_BUFFER_GROWTH 2
#define CBOR_MAX_STACK_SIZE 2048
#define CBOR_PRETTY_PRINTER 1
diff --git a/code/contrib/libfido2/include/cbor/encoding.h b/code/contrib/libfido2/include/cbor/encoding.h
index 7446e145..bcc04f8a 100644
--- a/code/contrib/libfido2/include/cbor/encoding.h
+++ b/code/contrib/libfido2/include/cbor/encoding.h
@@ -27,50 +27,76 @@ extern "C" {
* case it is not modified).
*/
-CBOR_EXPORT size_t cbor_encode_uint8(uint8_t, unsigned char *, size_t);
+_CBOR_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD 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_NODISCARD CBOR_EXPORT size_t cbor_encode_bool(bool, unsigned char *,
+ size_t);
-CBOR_EXPORT size_t cbor_encode_null(unsigned char *, size_t);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_encode_null(unsigned char *, size_t);
-CBOR_EXPORT size_t cbor_encode_undef(unsigned char *, size_t);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_encode_undef(unsigned char *, size_t);
/** Encodes a half-precision float
*
@@ -93,15 +119,19 @@ CBOR_EXPORT size_t cbor_encode_undef(unsigned char *, size_t);
* - 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_NODISCARD 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_NODISCARD 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_NODISCARD CBOR_EXPORT size_t cbor_encode_double(double, unsigned char *,
+ size_t);
-CBOR_EXPORT size_t cbor_encode_break(unsigned char *, size_t);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_encode_break(unsigned char *, size_t);
-CBOR_EXPORT size_t cbor_encode_ctrl(uint8_t, unsigned char *, size_t);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_encode_ctrl(uint8_t, unsigned char *,
+ size_t);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/floats_ctrls.h b/code/contrib/libfido2/include/cbor/floats_ctrls.h
index 4b1ce594..70655367 100644
--- a/code/contrib/libfido2/include/cbor/floats_ctrls.h
+++ b/code/contrib/libfido2/include/cbor/floats_ctrls.h
@@ -26,14 +26,16 @@ extern "C" {
* @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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_float_width
+cbor_float_get_width(const cbor_item_t *item);
/** Get a half precision float
*
@@ -42,7 +44,8 @@ CBOR_EXPORT cbor_float_width cbor_float_get_width(const cbor_item_t *item);
* @param[borrow] A half precision float
* @return half precision value
*/
-CBOR_EXPORT float cbor_float_get_float2(const cbor_item_t *item);
+_CBOR_NODISCARD CBOR_EXPORT float cbor_float_get_float2(
+ const cbor_item_t *item);
/** Get a single precision float
*
@@ -51,7 +54,8 @@ CBOR_EXPORT float cbor_float_get_float2(const cbor_item_t *item);
* @param[borrow] A single precision float
* @return single precision value
*/
-CBOR_EXPORT float cbor_float_get_float4(const cbor_item_t *item);
+_CBOR_NODISCARD CBOR_EXPORT float cbor_float_get_float4(
+ const cbor_item_t *item);
/** Get a double precision float
*
@@ -60,7 +64,8 @@ CBOR_EXPORT float cbor_float_get_float4(const cbor_item_t *item);
* @param[borrow] A double precision float
* @return double precision value
*/
-CBOR_EXPORT double cbor_float_get_float8(const cbor_item_t *item);
+_CBOR_NODISCARD CBOR_EXPORT double cbor_float_get_float8(
+ const cbor_item_t *item);
/** Get the float value represented as double
*
@@ -69,14 +74,15 @@ CBOR_EXPORT double cbor_float_get_float8(const cbor_item_t *item);
* @param[borrow] Any float
* @return double precision value
*/
-CBOR_EXPORT double cbor_float_get_float(const cbor_item_t *item);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT bool cbor_get_bool(const cbor_item_t *item);
/** Constructs a new ctrl item
*
@@ -84,7 +90,7 @@ CBOR_EXPORT bool cbor_get_bool(const cbor_item_t *item);
*
* @return **new** 1B ctrl or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_ctrl();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_ctrl(void);
/** Constructs a new float item
*
@@ -92,7 +98,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_ctrl();
*
* @return **new** 2B float or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_float2();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_float2(void);
/** Constructs a new float item
*
@@ -100,7 +106,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_float2();
*
* @return **new** 4B float or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_float4();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_float4(void);
/** Constructs a new float item
*
@@ -108,26 +114,26 @@ CBOR_EXPORT cbor_item_t *cbor_new_float4();
*
* @return **new** 8B float or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_float8();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_float8(void);
/** Constructs new null ctrl item
*
* @return **new** null ctrl item or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_null();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_null(void);
/** Constructs new undef ctrl item
*
* @return **new** undef ctrl item or `NULL` upon memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_undef();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_undef(void);
/** 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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_bool(bool value);
/** Assign a control value
*
@@ -175,35 +181,35 @@ CBOR_EXPORT void cbor_set_float8(cbor_item_t *item, double value);
* @param item[borrow] A ctrl item
* @return the simple value
*/
-CBOR_EXPORT uint8_t cbor_ctrl_value(const cbor_item_t *item);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_ctrl(uint8_t value);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h b/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h
index 4776435a..7893960e 100644
--- a/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h
+++ b/code/contrib/libfido2/include/cbor/internal/builder_callbacks.h
@@ -26,6 +26,10 @@ struct _cbor_decoder_context {
struct _cbor_stack *stack;
};
+/** Internal helper: Append item to the top of the stack while handling errors.
+ */
+void _cbor_builder_append(cbor_item_t *item, struct _cbor_decoder_context *ctx);
+
void cbor_builder_uint8_callback(void *, uint8_t);
void cbor_builder_uint16_callback(void *, uint16_t);
diff --git a/code/contrib/libfido2/include/cbor/internal/encoders.h b/code/contrib/libfido2/include/cbor/internal/encoders.h
index 14ad5015..7eadb712 100644
--- a/code/contrib/libfido2/include/cbor/internal/encoders.h
+++ b/code/contrib/libfido2/include/cbor/internal/encoders.h
@@ -14,18 +14,23 @@
extern "C" {
#endif
+_CBOR_NODISCARD
size_t _cbor_encode_uint8(uint8_t value, unsigned char *buffer,
size_t buffer_size, uint8_t offset);
+_CBOR_NODISCARD
size_t _cbor_encode_uint16(uint16_t value, unsigned char *buffer,
size_t buffer_size, uint8_t offset);
+_CBOR_NODISCARD
size_t _cbor_encode_uint32(uint32_t value, unsigned char *buffer,
size_t buffer_size, uint8_t offset);
+_CBOR_NODISCARD
size_t _cbor_encode_uint64(uint64_t value, unsigned char *buffer,
size_t buffer_size, uint8_t offset);
+_CBOR_NODISCARD
size_t _cbor_encode_uint(uint64_t value, unsigned char *buffer,
size_t buffer_size, uint8_t offset);
diff --git a/code/contrib/libfido2/include/cbor/internal/loaders.h b/code/contrib/libfido2/include/cbor/internal/loaders.h
index c8fb9187..ce37563a 100644
--- a/code/contrib/libfido2/include/cbor/internal/loaders.h
+++ b/code/contrib/libfido2/include/cbor/internal/loaders.h
@@ -15,18 +15,25 @@ extern "C" {
#endif
/* Read the given uint from the given location, no questions asked */
+_CBOR_NODISCARD
uint8_t _cbor_load_uint8(const unsigned char *source);
+_CBOR_NODISCARD
uint16_t _cbor_load_uint16(const unsigned char *source);
+_CBOR_NODISCARD
uint32_t _cbor_load_uint32(const unsigned char *source);
+_CBOR_NODISCARD
uint64_t _cbor_load_uint64(const unsigned char *source);
+_CBOR_NODISCARD
float _cbor_load_half(cbor_data source);
+_CBOR_NODISCARD
float _cbor_load_float(cbor_data source);
+_CBOR_NODISCARD
double _cbor_load_double(cbor_data source);
#ifdef __cplusplus
diff --git a/code/contrib/libfido2/include/cbor/internal/memory_utils.h b/code/contrib/libfido2/include/cbor/internal/memory_utils.h
index c41ace67..14843c8c 100644
--- a/code/contrib/libfido2/include/cbor/internal/memory_utils.h
+++ b/code/contrib/libfido2/include/cbor/internal/memory_utils.h
@@ -11,9 +11,20 @@
#include
#include
-/** Can a and b be multiplied without overflowing size_t? */
+#include "cbor/common.h"
+
+/** Can `a` and `b` be multiplied without overflowing size_t? */
+_CBOR_NODISCARD
bool _cbor_safe_to_multiply(size_t a, size_t b);
+/** Can `a` and `b` be added without overflowing size_t? */
+_CBOR_NODISCARD
+bool _cbor_safe_to_add(size_t a, size_t b);
+
+/** Adds `a` and `b`, propagating zeros and returing 0 on overflow. */
+_CBOR_NODISCARD
+size_t _cbor_safe_signaling_add(size_t a, size_t b);
+
/** Overflow-proof contiguous array allocation
*
* @param item_size
diff --git a/code/contrib/libfido2/include/cbor/internal/stack.h b/code/contrib/libfido2/include/cbor/internal/stack.h
index 42ed0442..cf2206b4 100644
--- a/code/contrib/libfido2/include/cbor/internal/stack.h
+++ b/code/contrib/libfido2/include/cbor/internal/stack.h
@@ -16,8 +16,18 @@ extern "C" {
/** Simple stack record for the parser */
struct _cbor_stack_record {
+ /** Pointer to the parent stack frame */
struct _cbor_stack_record *lower;
+ /** Item under construction */
cbor_item_t *item;
+ /**
+ * How many outstanding subitems are expected.
+ *
+ * For example, when we see a new definite array, `subitems` is initialized to
+ * the array length. With every item added, the counter is decreased. When it
+ * reaches zero, the stack is popped and the complete item is propagated
+ * upwards.
+ */
size_t subitems;
};
@@ -27,10 +37,12 @@ struct _cbor_stack {
size_t size;
};
-struct _cbor_stack _cbor_stack_init();
+_CBOR_NODISCARD
+struct _cbor_stack _cbor_stack_init(void);
void _cbor_stack_pop(struct _cbor_stack *);
+_CBOR_NODISCARD
struct _cbor_stack_record *_cbor_stack_push(struct _cbor_stack *, cbor_item_t *,
size_t);
diff --git a/code/contrib/libfido2/include/cbor/internal/unicode.h b/code/contrib/libfido2/include/cbor/internal/unicode.h
index 0d266199..af32cc7f 100644
--- a/code/contrib/libfido2/include/cbor/internal/unicode.h
+++ b/code/contrib/libfido2/include/cbor/internal/unicode.h
@@ -22,6 +22,7 @@ struct _cbor_unicode_status {
uint64_t location;
};
+_CBOR_NODISCARD
uint64_t _cbor_unicode_codepoint_count(cbor_data source, uint64_t source_length,
struct _cbor_unicode_status* status);
diff --git a/code/contrib/libfido2/include/cbor/ints.h b/code/contrib/libfido2/include/cbor/ints.h
index fc7de600..9c1d5723 100644
--- a/code/contrib/libfido2/include/cbor/ints.h
+++ b/code/contrib/libfido2/include/cbor/ints.h
@@ -26,35 +26,35 @@ extern "C" {
* @param item[borrow] positive or negative integer
* @return the value
*/
-CBOR_EXPORT uint8_t cbor_get_uint8(const cbor_item_t *item);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT uint64_t cbor_get_int(const cbor_item_t *item);
/** Assigns the integer value
*
@@ -93,7 +93,8 @@ CBOR_EXPORT void cbor_set_uint64(cbor_item_t *item, uint64_t value);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_int_width
+cbor_int_get_width(const cbor_item_t *item);
/** Marks the integer item as a positive integer
*
@@ -118,7 +119,7 @@ CBOR_EXPORT void cbor_mark_negint(cbor_item_t *item);
* @return **new** positive integer or `NULL` on memory allocation failure. The
* value is not initialized
*/
-CBOR_EXPORT cbor_item_t *cbor_new_int8();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_int8(void);
/** Allocates new integer with 2B width
*
@@ -127,7 +128,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_int8();
* @return **new** positive integer or `NULL` on memory allocation failure. The
* value is not initialized
*/
-CBOR_EXPORT cbor_item_t *cbor_new_int16();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_int16(void);
/** Allocates new integer with 4B width
*
@@ -136,7 +137,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_int16();
* @return **new** positive integer or `NULL` on memory allocation failure. The
* value is not initialized
*/
-CBOR_EXPORT cbor_item_t *cbor_new_int32();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_int32(void);
/** Allocates new integer with 8B width
*
@@ -145,63 +146,63 @@ CBOR_EXPORT cbor_item_t *cbor_new_int32();
* @return **new** positive integer or `NULL` on memory allocation failure. The
* value is not initialized
*/
-CBOR_EXPORT cbor_item_t *cbor_new_int64();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_int64(void);
/** 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_negint64(uint64_t value);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/maps.h b/code/contrib/libfido2/include/cbor/maps.h
index 05ce5451..2c57412c 100644
--- a/code/contrib/libfido2/include/cbor/maps.h
+++ b/code/contrib/libfido2/include/cbor/maps.h
@@ -26,28 +26,27 @@ extern "C" {
* @param item[borrow] A map
* @return The number of pairs
*/
-CBOR_EXPORT size_t cbor_map_size(const cbor_item_t *item);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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.
+ * @return **new** indefinite map. `NULL` on malloc failure.
*/
-CBOR_EXPORT cbor_item_t *cbor_new_indefinite_map();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_indefinite_map(void);
/** Add a pair to the map
*
@@ -59,7 +58,8 @@ CBOR_EXPORT cbor_item_t *cbor_new_indefinite_map();
* @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);
+_CBOR_NODISCARD CBOR_EXPORT bool cbor_map_add(cbor_item_t *item,
+ struct cbor_pair pair);
/** Add a key to the map
*
@@ -70,7 +70,8 @@ CBOR_EXPORT bool cbor_map_add(cbor_item_t *item, struct cbor_pair pair);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT bool _cbor_map_add_key(cbor_item_t *item,
+ cbor_item_t *key);
/** Add a value to the map
*
@@ -81,21 +82,23 @@ CBOR_EXPORT bool _cbor_map_add_key(cbor_item_t *item, cbor_item_t *key);
* @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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT bool cbor_map_is_indefinite(
+ const cbor_item_t *item);
/** Get the pairs storage
*
@@ -103,7 +106,8 @@ CBOR_EXPORT bool cbor_map_is_indefinite(const cbor_item_t *item);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT struct cbor_pair *cbor_map_handle(
+ const cbor_item_t *item);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/serialization.h b/code/contrib/libfido2/include/cbor/serialization.h
index d63815e2..a4921f99 100644
--- a/code/contrib/libfido2/include/cbor/serialization.h
+++ b/code/contrib/libfido2/include/cbor/serialization.h
@@ -28,19 +28,36 @@ extern "C" {
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize(const cbor_item_t *item,
+ cbor_mutable_data buffer,
+ size_t buffer_size);
+
+/** Compute the length (in bytes) of the item when serialized using
+ * `cbor_serialize`.
+ *
+ * Time complexity is proportional to the number of nested items.
+ *
+ * @param item[borrow] A data item
+ * @return Length (>= 1) of the item when serialized. 0 if the length overflows
+ * `size_t`.
+ */
+_CBOR_NODISCARD CBOR_EXPORT size_t
+cbor_serialized_size(const cbor_item_t *item);
/** Serialize the given item, allocating buffers as needed
+ *
+ * Since libcbor v0.10, the return value is always the same as `buffer_size` (if
+ * provided, see https://github.com/PJK/libcbor/pull/251/). New clients should
+ * ignore the return value.
*
* \rst
- * .. warning:: It is your responsibility to free the buffer using an
+ * .. warning:: It is the caller's 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
+ * @param buffer_size[out] Size of the \p buffer, or ``NULL``
* @return Length of the result. 0 on failure, in which case \p buffer is
* ``NULL``.
*/
@@ -55,8 +72,9 @@ CBOR_EXPORT size_t cbor_serialize_alloc(const cbor_item_t *item,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_uint(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize a negint
*
@@ -65,8 +83,9 @@ CBOR_EXPORT size_t cbor_serialize_uint(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_negint(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize a bytestring
*
@@ -75,8 +94,8 @@ CBOR_EXPORT size_t cbor_serialize_negint(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t
+cbor_serialize_bytestring(const cbor_item_t *, cbor_mutable_data, size_t);
/** Serialize a string
*
@@ -85,8 +104,9 @@ CBOR_EXPORT size_t cbor_serialize_bytestring(const cbor_item_t *,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_string(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize an array
*
@@ -95,8 +115,9 @@ CBOR_EXPORT size_t cbor_serialize_string(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_array(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize a map
*
@@ -105,8 +126,9 @@ CBOR_EXPORT size_t cbor_serialize_array(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_map(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize a tag
*
@@ -115,8 +137,9 @@ CBOR_EXPORT size_t cbor_serialize_map(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_serialize_tag(const cbor_item_t *,
+ cbor_mutable_data,
+ size_t);
/** Serialize a
*
@@ -125,8 +148,8 @@ CBOR_EXPORT size_t cbor_serialize_tag(const cbor_item_t *, cbor_mutable_data,
* @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);
+_CBOR_NODISCARD CBOR_EXPORT size_t
+cbor_serialize_float_ctrl(const cbor_item_t *, cbor_mutable_data, size_t);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/streaming.h b/code/contrib/libfido2/include/cbor/streaming.h
index 54a17bcd..cb908e17 100644
--- a/code/contrib/libfido2/include/cbor/streaming.h
+++ b/code/contrib/libfido2/include/cbor/streaming.h
@@ -26,7 +26,7 @@ extern "C" {
* @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_NODISCARD CBOR_EXPORT struct cbor_decoder_result cbor_stream_decode(
cbor_data source, size_t source_size,
const struct cbor_callbacks* callbacks, void* context);
diff --git a/code/contrib/libfido2/include/cbor/strings.h b/code/contrib/libfido2/include/cbor/strings.h
index 49398af8..b9899c4b 100644
--- a/code/contrib/libfido2/include/cbor/strings.h
+++ b/code/contrib/libfido2/include/cbor/strings.h
@@ -21,14 +21,15 @@ extern "C" {
* ============================================================================
*/
-/** Returns the length of the underlying string
+/** Returns the length of the underlying string in bytes
*
- * For definite strings only
+ * There can be fewer unicode character than bytes (see
+ * `cbor_string_codepoint_count`). 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);
+_CBOR_NODISCARD CBOR_EXPORT size_t cbor_string_length(const cbor_item_t *item);
/** The number of codepoints in this string
*
@@ -37,21 +38,24 @@ CBOR_EXPORT size_t cbor_string_length(const cbor_item_t *item);
* @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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT bool cbor_string_is_indefinite(
+ const cbor_item_t *item);
/** Get the handle to the underlying string
*
@@ -62,7 +66,8 @@ CBOR_EXPORT bool cbor_string_is_indefinite(const cbor_item_t *item);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_mutable_data
+cbor_string_handle(const cbor_item_t *item);
/** Set the handle to the underlying string
*
@@ -90,14 +95,16 @@ CBOR_EXPORT void cbor_string_set_handle(
* @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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT size_t
+cbor_string_chunk_count(const cbor_item_t *item);
/** Appends a chunk to the string
*
@@ -110,7 +117,8 @@ CBOR_EXPORT size_t cbor_string_chunk_count(const cbor_item_t *item);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT bool cbor_string_add_chunk(cbor_item_t *item,
+ cbor_item_t *chunk);
/** Creates a new definite string
*
@@ -118,7 +126,7 @@ CBOR_EXPORT bool cbor_string_add_chunk(cbor_item_t *item, cbor_item_t *chunk);
*
* @return **new** definite string. `NULL` on malloc failure.
*/
-CBOR_EXPORT cbor_item_t *cbor_new_definite_string();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_definite_string(void);
/** Creates a new indefinite string
*
@@ -126,7 +134,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_definite_string();
*
* @return **new** indefinite string. `NULL` on malloc failure.
*/
-CBOR_EXPORT cbor_item_t *cbor_new_indefinite_string();
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_new_indefinite_string(void);
/** Creates a new string and initializes it
*
@@ -135,7 +143,7 @@ CBOR_EXPORT cbor_item_t *cbor_new_indefinite_string();
* @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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_string(const char *val);
/** Creates a new string and initializes it
*
@@ -144,7 +152,8 @@ CBOR_EXPORT cbor_item_t *cbor_build_string(const char *val);
* @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);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_stringn(const char *val,
+ size_t length);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/cbor/tags.h b/code/contrib/libfido2/include/cbor/tags.h
index f4b8028f..1fac44a5 100644
--- a/code/contrib/libfido2/include/cbor/tags.h
+++ b/code/contrib/libfido2/include/cbor/tags.h
@@ -27,21 +27,21 @@ extern "C" {
* @return **new** tag. Item reference is `NULL`. Returns `NULL` upon
* memory allocation failure
*/
-CBOR_EXPORT cbor_item_t *cbor_new_tag(uint64_t value);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD 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);
+_CBOR_NODISCARD CBOR_EXPORT uint64_t cbor_tag_value(const cbor_item_t *item);
/** Set the tagged item
*
@@ -56,7 +56,8 @@ CBOR_EXPORT void cbor_tag_set_item(cbor_item_t *item, cbor_item_t *tagged_item);
* @param value Tag value
* @return **new** tag item
*/
-CBOR_EXPORT cbor_item_t *cbor_build_tag(uint64_t value, cbor_item_t *item);
+_CBOR_NODISCARD CBOR_EXPORT cbor_item_t *cbor_build_tag(uint64_t value,
+ cbor_item_t *item);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/fido.h b/code/contrib/libfido2/include/fido.h
index ce7da160..607c44fc 100644
--- a/code/contrib/libfido2/include/fido.h
+++ b/code/contrib/libfido2/include/fido.h
@@ -124,6 +124,7 @@ 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_empty_allow_list(fido_assert_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 *,
@@ -143,6 +144,7 @@ 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_empty_exclude_list(fido_cred_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);
diff --git a/code/contrib/libfido2/include/fido/eddsa.h b/code/contrib/libfido2/include/fido/eddsa.h
index 7981a6f8..5c0b681e 100644
--- a/code/contrib/libfido2/include/fido/eddsa.h
+++ b/code/contrib/libfido2/include/fido/eddsa.h
@@ -53,7 +53,7 @@ int eddsa_pk_from_ptr(eddsa_pk_t *, const void *, size_t);
#ifdef _FIDO_INTERNAL
-#if defined(LIBRESSL_VERSION_NUMBER)
+#if defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x3070000f
#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 *,
diff --git a/code/contrib/libfido2/include/openssl/asn1.h b/code/contrib/libfido2/include/openssl/asn1.h
index e569e875..ff42e456 100644
--- a/code/contrib/libfido2/include/openssl/asn1.h
+++ b/code/contrib/libfido2/include/openssl/asn1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1.h,v 1.62 2022/01/14 08:53:53 tb Exp $ */
+/* $OpenBSD: asn1.h,v 1.70 2022/09/11 17:22:52 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -547,8 +547,6 @@ 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);
@@ -577,9 +575,6 @@ 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);
@@ -599,9 +594,6 @@ 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);
@@ -719,6 +711,11 @@ 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_to_tm(const ASN1_TIME *s, struct tm *tm);
+int ASN1_TIME_compare(const ASN1_TIME *t1, const ASN1_TIME *t2);
+int ASN1_TIME_cmp_time_t(const ASN1_TIME *s, time_t t2);
+int ASN1_TIME_normalize(ASN1_TIME *t);
+int ASN1_TIME_set_string_X509(ASN1_TIME *time, const char *str);
int ASN1_TIME_diff(int *pday, int *psec, const ASN1_TIME *from,
const ASN1_TIME *to);
@@ -748,11 +745,17 @@ 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_get_uint64(uint64_t *out_val, const ASN1_INTEGER *aint);
+int ASN1_INTEGER_set_uint64(ASN1_INTEGER *aint, uint64_t val);
+int ASN1_INTEGER_get_int64(int64_t *out_val, const ASN1_INTEGER *aint);
+int ASN1_INTEGER_set_int64(ASN1_INTEGER *aint, int64_t val);
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_get_int64(int64_t *out_val, const ASN1_ENUMERATED *aenum);
+int ASN1_ENUMERATED_set_int64(ASN1_ENUMERATED *aenum, int64_t val);
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);
@@ -936,10 +939,6 @@ 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. */
@@ -1109,6 +1108,7 @@ void ERR_load_ASN1_strings(void);
#define ASN1_R_ILLEGAL_HEX 178
#define ASN1_R_ILLEGAL_IMPLICIT_TAG 179
#define ASN1_R_ILLEGAL_INTEGER 180
+#define ASN1_R_ILLEGAL_NEGATIVE_VALUE 226
#define ASN1_R_ILLEGAL_NESTED_TAGGING 181
#define ASN1_R_ILLEGAL_NULL 125
#define ASN1_R_ILLEGAL_NULL_VALUE 182
@@ -1168,8 +1168,11 @@ void ERR_load_ASN1_strings(void);
#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_LARGE 223
#define ASN1_R_TOO_LONG 155
+#define ASN1_R_TOO_SMALL 224
#define ASN1_R_TYPE_NOT_CONSTRUCTED 156
+#define ASN1_R_TYPE_NOT_PRIMITIVE 231
#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
@@ -1186,11 +1189,11 @@ void ERR_load_ASN1_strings(void);
#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_INTEGER_TYPE 225
#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
diff --git a/code/contrib/libfido2/include/openssl/asn1t.h b/code/contrib/libfido2/include/openssl/asn1t.h
index 892c8b70..bb49be28 100644
--- a/code/contrib/libfido2/include/openssl/asn1t.h
+++ b/code/contrib/libfido2/include/openssl/asn1t.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1t.h,v 1.19 2022/01/14 08:43:06 tb Exp $ */
+/* $OpenBSD: asn1t.h,v 1.22 2022/09/03 16:01:23 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -183,10 +183,6 @@ extern "C" {
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)
@@ -219,8 +215,6 @@ extern "C" {
#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)
@@ -352,11 +346,6 @@ extern "C" {
(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) \
@@ -569,17 +558,6 @@ struct ASN1_ADB_TABLE_st {
#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
@@ -761,8 +739,6 @@ typedef struct ASN1_STREAM_ARG_st {
#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 */
@@ -906,11 +882,14 @@ 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;
+#ifndef LIBRESSL_INTERNAL
+extern const ASN1_ITEM CBIGNUM_it;
+#endif
+
DECLARE_STACK_OF(ASN1_VALUE)
/* Functions used internally by the ASN1 code */
diff --git a/code/contrib/libfido2/include/openssl/bio.h b/code/contrib/libfido2/include/openssl/bio.h
index d4bf8cb3..53217f80 100644
--- a/code/contrib/libfido2/include/openssl/bio.h
+++ b/code/contrib/libfido2/include/openssl/bio.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bio.h,v 1.54 2022/01/14 08:40:57 tb Exp $ */
+/* $OpenBSD: bio.h,v 1.56 2022/09/11 17:26:03 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -276,8 +276,9 @@ 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);
+/* Compatibility with OpenSSL's backward compatibility. */
+typedef BIO_info_cb bio_info_cb;
typedef struct bio_method_st BIO_METHOD;
@@ -698,11 +699,6 @@ BIO_vsnprintf(char *buf, size_t n, const char *format, va_list args)
__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. */
diff --git a/code/contrib/libfido2/include/openssl/bn.h b/code/contrib/libfido2/include/openssl/bn.h
index abf8cfcf..5ac41438 100644
--- a/code/contrib/libfido2/include/openssl/bn.h
+++ b/code/contrib/libfido2/include/openssl/bn.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: bn.h,v 1.52 2022/01/14 08:01:47 tb Exp $ */
+/* $OpenBSD: bn.h,v 1.55 2022/07/12 14:42:48 kn Exp $ */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -471,6 +471,8 @@ BIGNUM *BN_mod_sqrt(BIGNUM *ret,
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
+int BN_security_bits(int L, int N);
+
/* Deprecated versions */
#ifndef OPENSSL_NO_DEPRECATED
BIGNUM *BN_generate_prime(BIGNUM *ret, int bits, int safe,
@@ -651,10 +653,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/buffer.h b/code/contrib/libfido2/include/openssl/buffer.h
index ed6dac0e..c210bfd1 100644
--- a/code/contrib/libfido2/include/openssl/buffer.h
+++ b/code/contrib/libfido2/include/openssl/buffer.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: buffer.h,v 1.15 2015/06/24 10:05:14 jsing Exp $ */
+/* $OpenBSD: buffer.h,v 1.16 2022/07/12 14:42:48 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -98,10 +98,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/conf.h b/code/contrib/libfido2/include/openssl/conf.h
index bea6a871..5d10163b 100644
--- a/code/contrib/libfido2/include/openssl/conf.h
+++ b/code/contrib/libfido2/include/openssl/conf.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: conf.h,v 1.15 2020/02/17 12:51:48 inoguchi Exp $ */
+/* $OpenBSD: conf.h,v 1.16 2022/07/12 14:42:48 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -193,10 +193,6 @@ int CONF_parse_list(const char *list, int sep, int nospc,
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. */
diff --git a/code/contrib/libfido2/include/openssl/crypto.h b/code/contrib/libfido2/include/openssl/crypto.h
index 5524feec..3b00f039 100644
--- a/code/contrib/libfido2/include/openssl/crypto.h
+++ b/code/contrib/libfido2/include/openssl/crypto.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: crypto.h,v 1.54 2022/01/14 08:23:25 tb Exp $ */
+/* $OpenBSD: crypto.h,v 1.57 2022/09/11 17:26:51 tb Exp $ */
/* ====================================================================
* Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.
*
@@ -509,10 +509,6 @@ void OPENSSL_init(void);
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. */
@@ -566,6 +562,7 @@ void ERR_load_CRYPTO_strings(void);
#define OPENSSL_INIT_ENGINE_ALL_BUILTIN _OPENSSL_INIT_FLAG_NOOP
int OPENSSL_init_crypto(uint64_t opts, const void *settings);
+void OPENSSL_cleanup(void);
#ifdef __cplusplus
}
diff --git a/code/contrib/libfido2/include/openssl/ct.h b/code/contrib/libfido2/include/openssl/ct.h
index 2b549037..895046e0 100644
--- a/code/contrib/libfido2/include/openssl/ct.h
+++ b/code/contrib/libfido2/include/openssl/ct.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ct.h,v 1.6 2021/12/18 16:50:40 tb Exp $ */
+/* $OpenBSD: ct.h,v 1.7 2022/05/08 20:59:32 tb Exp $ */
/*
* Public API for Certificate Transparency (CT).
* Written by Rob Percival (robpercival@google.com) for the OpenSSL project.
@@ -61,7 +61,6 @@
#include
#include
#include
-#include
#ifdef __cplusplus
extern "C" {
#endif
@@ -507,6 +506,60 @@ int CTLOG_STORE_load_file(CTLOG_STORE *store, const char *file);
*/
int CTLOG_STORE_load_default_file(CTLOG_STORE *store);
+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
+
#ifdef __cplusplus
}
#endif
diff --git a/code/contrib/libfido2/include/openssl/cterr.h b/code/contrib/libfido2/include/openssl/cterr.h
deleted file mode 100644
index 07ae519b..00000000
--- a/code/contrib/libfido2/include/openssl/cterr.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/* $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/dh.h b/code/contrib/libfido2/include/openssl/dh.h
index ef104950..7b226a70 100644
--- a/code/contrib/libfido2/include/openssl/dh.h
+++ b/code/contrib/libfido2/include/openssl/dh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dh.h,v 1.32 2022/01/14 08:25:44 tb Exp $ */
+/* $OpenBSD: dh.h,v 1.35 2022/07/12 14:42:49 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -143,6 +143,7 @@ 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);
+int DH_security_bits(const DH *dh);
ENGINE *DH_get0_engine(DH *d);
void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q,
@@ -195,10 +196,6 @@ int DHparams_print(char *bp, const DH *x);
#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. */
diff --git a/code/contrib/libfido2/include/openssl/dsa.h b/code/contrib/libfido2/include/openssl/dsa.h
index 4fafce38..eab35a6f 100644
--- a/code/contrib/libfido2/include/openssl/dsa.h
+++ b/code/contrib/libfido2/include/openssl/dsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa.h,v 1.35 2022/01/14 08:27:23 tb Exp $ */
+/* $OpenBSD: dsa.h,v 1.39 2022/07/12 14:42:49 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -151,6 +151,7 @@ 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);
+int DSA_security_bits(const DSA *d);
DSA *d2i_DSAPublicKey(DSA **a, const unsigned char **pp, long length);
int i2d_DSAPublicKey(const DSA *a, unsigned char **pp);
@@ -219,6 +220,8 @@ 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);
+const char *DSA_meth_get0_name(const DSA_METHOD *meth);
+int DSA_meth_set1_name(DSA_METHOD *meth, const char *name);
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 *));
@@ -231,10 +234,6 @@ int DSA_meth_set_finish(DSA_METHOD *meth, int (*finish)(DSA *));
#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. */
diff --git a/code/contrib/libfido2/include/openssl/dso.h b/code/contrib/libfido2/include/openssl/dso.h
index 6c982c9f..ae07b0a5 100644
--- a/code/contrib/libfido2/include/openssl/dso.h
+++ b/code/contrib/libfido2/include/openssl/dso.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: dso.h,v 1.12 2016/03/15 20:50:22 krw Exp $ */
+/* $OpenBSD: dso.h,v 1.13 2022/07/12 14:42:49 kn Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@@ -302,10 +302,6 @@ int DSO_pathbyaddr(void *addr, char *path, int sz);
* 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. */
diff --git a/code/contrib/libfido2/include/openssl/ec.h b/code/contrib/libfido2/include/openssl/ec.h
index d8ff42c0..52c8f2f3 100644
--- a/code/contrib/libfido2/include/openssl/ec.h
+++ b/code/contrib/libfido2/include/openssl/ec.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec.h,v 1.27 2021/09/12 16:23:19 tb Exp $ */
+/* $OpenBSD: ec.h,v 1.28 2022/07/12 14:42:49 kn Exp $ */
/*
* Originally written by Bodo Moeller for the OpenSSL project.
*/
@@ -1116,10 +1116,6 @@ EC_KEY *ECParameters_dup(EC_KEY *key);
#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. */
diff --git a/code/contrib/libfido2/include/openssl/ecdh.h b/code/contrib/libfido2/include/openssl/ecdh.h
index ccc1312f..b39a90f1 100644
--- a/code/contrib/libfido2/include/openssl/ecdh.h
+++ b/code/contrib/libfido2/include/openssl/ecdh.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecdh.h,v 1.5 2015/09/13 12:03:07 jsing Exp $ */
+/* $OpenBSD: ecdh.h,v 1.6 2022/07/12 14:42:49 kn Exp $ */
/* ====================================================================
* Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
*
@@ -102,10 +102,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/ecdsa.h b/code/contrib/libfido2/include/openssl/ecdsa.h
index eccca65b..29ee8729 100644
--- a/code/contrib/libfido2/include/openssl/ecdsa.h
+++ b/code/contrib/libfido2/include/openssl/ecdsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ecdsa.h,v 1.11 2022/01/14 08:31:03 tb Exp $ */
+/* $OpenBSD: ecdsa.h,v 1.12 2022/07/12 14:42:49 kn Exp $ */
/**
* \file crypto/ecdsa/ecdsa.h Include file for the OpenSSL ECDSA functions
* \author Written by Nils Larsch for the OpenSSL project
@@ -293,11 +293,6 @@ void EC_KEY_METHOD_get_verify(const EC_KEY_METHOD *meth,
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. */
diff --git a/code/contrib/libfido2/include/openssl/engine.h b/code/contrib/libfido2/include/openssl/engine.h
index dc14be8e..5c21647f 100644
--- a/code/contrib/libfido2/include/openssl/engine.h
+++ b/code/contrib/libfido2/include/openssl/engine.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: engine.h,v 1.33 2019/01/19 01:07:00 tb Exp $ */
+/* $OpenBSD: engine.h,v 1.34 2022/07/12 14:42:49 kn Exp $ */
/* Written by Geoff Thorpe (geoff@geoffthorpe.net) for the OpenSSL
* project 2000.
*/
@@ -716,10 +716,6 @@ typedef int (*dynamic_bind_engine)(ENGINE *e, const char *id,
* 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. */
diff --git a/code/contrib/libfido2/include/openssl/err.h b/code/contrib/libfido2/include/openssl/err.h
index 20fa9084..24708c5b 100644
--- a/code/contrib/libfido2/include/openssl/err.h
+++ b/code/contrib/libfido2/include/openssl/err.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: err.h,v 1.26 2021/11/24 01:12:43 beck Exp $ */
+/* $OpenBSD: err.h,v 1.28 2022/08/29 06:49:24 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -197,6 +197,7 @@ typedef struct err_state_st {
#define ERR_LIB_JPAKE 49
#define ERR_LIB_GOST 50
#define ERR_LIB_CT 51
+#define ERR_LIB_KDF 52
#define ERR_LIB_USER 128
@@ -236,6 +237,7 @@ typedef struct err_state_st {
#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__)
+#define KDFerr(f, r) ERR_PUT_error(ERR_LIB_KDF,(f),(r),__FILE__,__LINE__)
#endif
#ifdef LIBRESSL_INTERNAL
@@ -273,6 +275,7 @@ typedef struct err_state_st {
#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__)
+#define KDFerror(r) ERR_PUT_error(ERR_LIB_KDF,(0xfff),(r),__FILE__,__LINE__)
#endif
#define ERR_PACK(l,f,r) (((((unsigned long)l)&0xffL)<<24L)| \
@@ -343,11 +346,11 @@ typedef struct err_state_st {
#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)
+#define ERR_R_INIT_FAIL (6|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;
diff --git a/code/contrib/libfido2/include/openssl/evp.h b/code/contrib/libfido2/include/openssl/evp.h
index a80cf189..d2bb376c 100644
--- a/code/contrib/libfido2/include/openssl/evp.h
+++ b/code/contrib/libfido2/include/openssl/evp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: evp.h,v 1.99 2022/01/14 08:38:05 tb Exp $ */
+/* $OpenBSD: evp.h,v 1.107 2022/09/11 17:29:24 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -112,6 +112,7 @@
#define EVP_PKEY_GOSTIMIT NID_id_Gost28147_89_MAC
#define EVP_PKEY_HMAC NID_hmac
#define EVP_PKEY_CMAC NID_cmac
+#define EVP_PKEY_HKDF NID_hkdf
#define EVP_PKEY_GOSTR12_256 NID_id_tc26_gost3410_2012_256
#define EVP_PKEY_GOSTR12_512 NID_id_tc26_gost3410_2012_512
@@ -250,10 +251,11 @@ extern "C" {
#define EVP_CTRL_AEAD_SET_IVLEN 0x9
#define EVP_CTRL_AEAD_GET_TAG 0x10
#define EVP_CTRL_AEAD_SET_TAG 0x11
+#define EVP_CTRL_AEAD_SET_IV_FIXED 0x12
#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_SET_IV_FIXED EVP_CTRL_AEAD_SET_IV_FIXED
#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
@@ -280,6 +282,21 @@ extern "C" {
/* Length of tag for TLS */
#define EVP_GCM_TLS_TAG_LEN 16
+/* CCM TLS constants */
+/* Length of fixed part of IV derived from PRF */
+#define EVP_CCM_TLS_FIXED_IV_LEN 4
+/* Length of explicit part of IV part of TLS records */
+#define EVP_CCM_TLS_EXPLICIT_IV_LEN 8
+/* Total length of CCM IV length for TLS */
+#define EVP_CCM_TLS_IV_LEN 12
+/* Length of tag for TLS */
+#define EVP_CCM_TLS_TAG_LEN 16
+/* Length of CCM8 tag for TLS */
+#define EVP_CCM8_TLS_TAG_LEN 8
+
+/* Length of tag for TLS */
+#define EVP_CHACHAPOLY_TLS_TAG_LEN 16
+
typedef struct evp_cipher_info_st {
const EVP_CIPHER *cipher;
unsigned char iv[EVP_MAX_IV_LENGTH];
@@ -679,6 +696,9 @@ 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_CHACHA) && !defined(OPENSSL_NO_POLY1305)
+const EVP_CIPHER *EVP_chacha20_poly1305(void);
+#endif
#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);
@@ -768,6 +788,7 @@ 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_security_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);
@@ -930,6 +951,8 @@ 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_security_bits(EVP_PKEY_ASN1_METHOD *ameth,
+ int (*pkey_security_bits)(const EVP_PKEY *pkey));
void EVP_PKEY_asn1_set_check(EVP_PKEY_ASN1_METHOD *ameth,
int (*pkey_check)(const EVP_PKEY *pk));
@@ -1258,10 +1281,6 @@ int EVP_AEAD_CTX_open(const EVP_AEAD_CTX *ctx, unsigned char *out,
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. */
diff --git a/code/contrib/libfido2/include/openssl/gost.h b/code/contrib/libfido2/include/openssl/gost.h
index 092f96fb..c7d9d25b 100644
--- a/code/contrib/libfido2/include/openssl/gost.h
+++ b/code/contrib/libfido2/include/openssl/gost.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: gost.h,v 1.3 2016/09/04 17:02:31 jsing Exp $ */
+/* $OpenBSD: gost.h,v 1.4 2022/07/12 14:42:49 kn Exp $ */
/*
* Copyright (c) 2014 Dmitry Eremin-Solenikov
* Copyright (c) 2005-2006 Cryptocom LTD
@@ -199,10 +199,6 @@ size_t GOST_KEY_get_size(const GOST_KEY * r);
#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. */
diff --git a/code/contrib/libfido2/include/openssl/kdf.h b/code/contrib/libfido2/include/openssl/kdf.h
new file mode 100644
index 00000000..f823bf99
--- /dev/null
+++ b/code/contrib/libfido2/include/openssl/kdf.h
@@ -0,0 +1,111 @@
+/* $OpenBSD: kdf.h,v 1.8 2022/07/12 14:42:49 kn Exp $ */
+/*
+ * Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
+ * project.
+ */
+/* ====================================================================
+ * Copyright (c) 2016-2018 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_KDF_H
+# define HEADER_KDF_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+# define EVP_PKEY_CTRL_HKDF_MD (EVP_PKEY_ALG_CTRL + 3)
+# define EVP_PKEY_CTRL_HKDF_SALT (EVP_PKEY_ALG_CTRL + 4)
+# define EVP_PKEY_CTRL_HKDF_KEY (EVP_PKEY_ALG_CTRL + 5)
+# define EVP_PKEY_CTRL_HKDF_INFO (EVP_PKEY_ALG_CTRL + 6)
+# define EVP_PKEY_CTRL_HKDF_MODE (EVP_PKEY_ALG_CTRL + 7)
+
+# define EVP_PKEY_HKDEF_MODE_EXTRACT_AND_EXPAND 0
+# define EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY 1
+# define EVP_PKEY_HKDEF_MODE_EXPAND_ONLY 2
+
+# define EVP_PKEY_CTX_set_hkdf_md(pctx, md) \
+ EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_HKDF_MD, 0, (void *)(md))
+
+# define EVP_PKEY_CTX_set1_hkdf_salt(pctx, salt, saltlen) \
+ EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_HKDF_SALT, saltlen, (void *)(salt))
+
+# define EVP_PKEY_CTX_set1_hkdf_key(pctx, key, keylen) \
+ EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_HKDF_KEY, keylen, (void *)(key))
+
+# define EVP_PKEY_CTX_add1_hkdf_info(pctx, info, infolen) \
+ EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_HKDF_INFO, infolen, (void *)(info))
+
+# define EVP_PKEY_CTX_hkdf_mode(pctx, mode) \
+ EVP_PKEY_CTX_ctrl(pctx, -1, EVP_PKEY_OP_DERIVE, \
+ EVP_PKEY_CTRL_HKDF_MODE, mode, NULL)
+
+int ERR_load_KDF_strings(void);
+
+/*
+ * KDF function codes.
+ */
+# define KDF_F_PKEY_HKDF_CTRL_STR 103
+# define KDF_F_PKEY_HKDF_DERIVE 102
+# define KDF_F_PKEY_HKDF_INIT 108
+
+/*
+ * KDF reason codes.
+ */
+# define KDF_R_MISSING_KEY 104
+# define KDF_R_MISSING_MESSAGE_DIGEST 105
+# define KDF_R_UNKNOWN_PARAMETER_TYPE 103
+
+# ifdef __cplusplus
+}
+# endif
+#endif
diff --git a/code/contrib/libfido2/include/openssl/obj_mac.h b/code/contrib/libfido2/include/openssl/obj_mac.h
index 5da2b5df..8c731439 100644
--- a/code/contrib/libfido2/include/openssl/obj_mac.h
+++ b/code/contrib/libfido2/include/openssl/obj_mac.h
@@ -885,6 +885,10 @@
#define NID_id_ct_ASPA 1017
#define OBJ_id_ct_ASPA OBJ_id_smime_ct,49L
+#define SN_id_ct_signedTAL "id-ct-signedTAL"
+#define NID_id_ct_signedTAL 1024
+#define OBJ_id_ct_signedTAL OBJ_id_smime_ct,50L
+
#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
@@ -1001,6 +1005,10 @@
#define NID_id_smime_aa_dvcs_dvc 240
#define OBJ_id_smime_aa_dvcs_dvc OBJ_id_smime_aa,29L
+#define SN_id_smime_aa_signingCertificateV2 "id-smime-aa-signingCertificateV2"
+#define NID_id_smime_aa_signingCertificateV2 1023
+#define OBJ_id_smime_aa_signingCertificateV2 OBJ_id_smime_aa,47L
+
#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
@@ -4250,6 +4258,10 @@
#define NID_ct_cert_scts 1021
#define OBJ_ct_cert_scts 1L,3L,6L,1L,4L,1L,11129L,2L,4L,5L
+#define SN_hkdf "HKDF"
+#define LN_hkdf "hkdf"
+#define NID_hkdf 1022
+
#define SN_teletrust "teletrust"
#define NID_teletrust 920
#define OBJ_teletrust OBJ_identified_organization,36L
diff --git a/code/contrib/libfido2/include/openssl/objects.h b/code/contrib/libfido2/include/openssl/objects.h
index 918928e2..fe3d7774 100644
--- a/code/contrib/libfido2/include/openssl/objects.h
+++ b/code/contrib/libfido2/include/openssl/objects.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: objects.h,v 1.17 2022/01/14 08:56:00 tb Exp $ */
+/* $OpenBSD: objects.h,v 1.18 2022/07/12 14:42:49 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1038,10 +1038,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/ocsp.h b/code/contrib/libfido2/include/openssl/ocsp.h
index f869f8aa..691ee4a3 100644
--- a/code/contrib/libfido2/include/openssl/ocsp.h
+++ b/code/contrib/libfido2/include/openssl/ocsp.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ocsp.h,v 1.19 2022/01/14 08:32:26 tb Exp $ */
+/* $OpenBSD: ocsp.h,v 1.20 2022/07/12 14:42:49 kn Exp $ */
/* Written by Tom Titchener for the OpenSSL
* project. */
@@ -421,10 +421,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/opensslconf.h b/code/contrib/libfido2/include/openssl/opensslconf.h
index bb717689..6e88a6e0 100644
--- a/code/contrib/libfido2/include/openssl/opensslconf.h
+++ b/code/contrib/libfido2/include/openssl/opensslconf.h
@@ -1,7 +1,7 @@
#include
/* crypto/opensslconf.h.in */
-#if defined(_MSC_VER) && !defined(__attribute__)
+#if defined(_MSC_VER) && !defined(__clang__) && !defined(__attribute__)
#define __attribute__(a)
#endif
diff --git a/code/contrib/libfido2/include/openssl/opensslfeatures.h b/code/contrib/libfido2/include/openssl/opensslfeatures.h
index 49a5f15b..48fcf40b 100644
--- a/code/contrib/libfido2/include/openssl/opensslfeatures.h
+++ b/code/contrib/libfido2/include/openssl/opensslfeatures.h
@@ -3,6 +3,7 @@
* are enabled, rather than not being able to tell when things are
* enabled (or possibly not yet not implemented, or removed!).
*/
+#define LIBRESSL_HAS_QUIC
#define LIBRESSL_HAS_TLS1_3
#define LIBRESSL_HAS_DTLS1_2
diff --git a/code/contrib/libfido2/include/openssl/opensslv.h b/code/contrib/libfido2/include/openssl/opensslv.h
index f24afb9c..dc38457b 100644
--- a/code/contrib/libfido2/include/openssl/opensslv.h
+++ b/code/contrib/libfido2/include/openssl/opensslv.h
@@ -1,11 +1,11 @@
-/* $OpenBSD: opensslv.h,v 1.69 2022/03/15 21:15:08 bcook Exp $ */
+/* $OpenBSD: opensslv.h,v 1.70 2022/07/04 12:31:55 tb Exp $ */
#ifndef HEADER_OPENSSLV_H
#define HEADER_OPENSSLV_H
/* These will change with each release of LibreSSL-portable */
-#define LIBRESSL_VERSION_NUMBER 0x3050300fL
+#define LIBRESSL_VERSION_NUMBER 0x3060200fL
/* ^ Patch starts here */
-#define LIBRESSL_VERSION_TEXT "LibreSSL 3.5.3"
+#define LIBRESSL_VERSION_TEXT "LibreSSL 3.6.2"
/* These will never change */
#define OPENSSL_VERSION_NUMBER 0x20000000L
diff --git a/code/contrib/libfido2/include/openssl/pem.h b/code/contrib/libfido2/include/openssl/pem.h
index 95f1e030..a0f7d78c 100644
--- a/code/contrib/libfido2/include/openssl/pem.h
+++ b/code/contrib/libfido2/include/openssl/pem.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pem.h,v 1.23 2022/01/14 07:52:24 tb Exp $ */
+/* $OpenBSD: pem.h,v 1.24 2022/07/12 14:42:50 kn Exp $ */
/* Copyright (C) 1995-1997 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -516,10 +516,6 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, pem_password_cb *cb,
#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. */
diff --git a/code/contrib/libfido2/include/openssl/pkcs12.h b/code/contrib/libfido2/include/openssl/pkcs12.h
index 56635f9d..44dbb381 100644
--- a/code/contrib/libfido2/include/openssl/pkcs12.h
+++ b/code/contrib/libfido2/include/openssl/pkcs12.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkcs12.h,v 1.24 2018/05/30 15:32:11 tb Exp $ */
+/* $OpenBSD: pkcs12.h,v 1.27 2022/09/11 17:30:13 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -96,43 +96,16 @@ extern "C" {
#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;
+typedef struct PKCS12_MAC_DATA_st PKCS12_MAC_DATA;
+
+typedef struct PKCS12_st PKCS12;
+
+typedef struct PKCS12_SAFEBAG_st 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;
+typedef struct pkcs12_bag_st PKCS12_BAGS;
#define PKCS12_ERROR 0
#define PKCS12_OK 1
@@ -155,29 +128,55 @@ typedef struct pkcs12_bag_st {
#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 M_PKCS12_bag_type PKCS12_bag_type
+#define M_PKCS12_cert_bag_type PKCS12_cert_bag_type
+#define M_PKCS12_crl_bag_type PKCS12_cert_bag_type
-#define PKCS8_get_attr(p8, attr_nid) \
- PKCS12_get_attr_gen(p8->attributes, attr_nid)
+#define PKCS12_bag_type PKCS12_SAFEBAG_get_nid
+#define PKCS12_cert_bag_type PKCS12_SAFEBAG_get_bag_nid
-#define PKCS12_mac_present(p12) ((p12)->mac ? 1 : 0)
+#define PKCS12_certbag2x509 PKCS12_SAFEBAG_get1_cert
+#define PKCS12_certbag2x509crl PKCS12_SAFEBAG_get1_crl
+#define PKCS12_x5092certbag PKCS12_SAFEBAG_create_cert
+#define PKCS12_x509crl2certbag PKCS12_SAFEBAG_create_crl
+#define PKCS12_MAKE_KEYBAG PKCS12_SAFEBAG_create0_p8inf
+#define PKCS12_MAKE_SHKEYBAG PKCS12_SAFEBAG_create_pkcs8_encrypt
-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);
+const ASN1_TYPE *PKCS12_SAFEBAG_get0_attr(const PKCS12_SAFEBAG *bag,
+ int attr_nid);
+const STACK_OF(X509_ATTRIBUTE) *
+ PKCS12_SAFEBAG_get0_attrs(const PKCS12_SAFEBAG *bag);
+int PKCS12_SAFEBAG_get_nid(const PKCS12_SAFEBAG *bag);
+int PKCS12_SAFEBAG_get_bag_nid(const PKCS12_SAFEBAG *bag);
+
+X509 *PKCS12_SAFEBAG_get1_cert(const PKCS12_SAFEBAG *bag);
+X509_CRL *PKCS12_SAFEBAG_get1_crl(const PKCS12_SAFEBAG *bag);
+
+ASN1_TYPE *PKCS8_get_attr(PKCS8_PRIV_KEY_INFO *p8, int attr_nid);
+int PKCS12_mac_present(const PKCS12 *p12);
+void PKCS12_get0_mac(const ASN1_OCTET_STRING **pmac, const X509_ALGOR **pmacalg,
+ const ASN1_OCTET_STRING **psalt, const ASN1_INTEGER **piter,
+ const PKCS12 *p12);
+
+PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_cert(X509 *x509);
+PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_crl(X509_CRL *crl);
+PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_p8inf(PKCS8_PRIV_KEY_INFO *p8);
+PKCS12_SAFEBAG *PKCS12_SAFEBAG_create0_pkcs8(X509_SIG *p8);
+PKCS12_SAFEBAG *PKCS12_SAFEBAG_create_pkcs8_encrypt(int pbe_nid,
+ const char *pass, int passlen, unsigned char *salt, int saltlen, int iter,
+ PKCS8_PRIV_KEY_INFO *p8);
+
+const PKCS8_PRIV_KEY_INFO *PKCS12_SAFEBAG_get0_p8inf(const PKCS12_SAFEBAG *bag);
+const X509_SIG *PKCS12_SAFEBAG_get0_pkcs8(const PKCS12_SAFEBAG *bag);
+const STACK_OF(PKCS12_SAFEBAG) *
+ PKCS12_SAFEBAG_get0_safes(const PKCS12_SAFEBAG *bag);
+const ASN1_OBJECT *PKCS12_SAFEBAG_get0_type(const 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,
@@ -185,9 +184,6 @@ PKCS8_PRIV_KEY_INFO *PKCS12_decrypt_skey(const PKCS12_SAFEBAG *bag,
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,
@@ -283,10 +279,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/pkcs7.h b/code/contrib/libfido2/include/openssl/pkcs7.h
index cff7c966..9ba3141c 100644
--- a/code/contrib/libfido2/include/openssl/pkcs7.h
+++ b/code/contrib/libfido2/include/openssl/pkcs7.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: pkcs7.h,v 1.18 2016/12/27 16:12:47 jsing Exp $ */
+/* $OpenBSD: pkcs7.h,v 1.19 2022/07/12 14:42:50 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -417,10 +417,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/rand.h b/code/contrib/libfido2/include/openssl/rand.h
index fcb2e921..a0e9b479 100644
--- a/code/contrib/libfido2/include/openssl/rand.h
+++ b/code/contrib/libfido2/include/openssl/rand.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rand.h,v 1.22 2014/10/22 14:02:52 jsing Exp $ */
+/* $OpenBSD: rand.h,v 1.23 2022/07/12 14:42:50 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -101,10 +101,6 @@ 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) */
diff --git a/code/contrib/libfido2/include/openssl/rsa.h b/code/contrib/libfido2/include/openssl/rsa.h
index d59fd03f..73ec9d5a 100644
--- a/code/contrib/libfido2/include/openssl/rsa.h
+++ b/code/contrib/libfido2/include/openssl/rsa.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: rsa.h,v 1.55 2022/01/14 08:34:39 tb Exp $ */
+/* $OpenBSD: rsa.h,v 1.58 2022/07/12 14:42:50 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -372,6 +372,8 @@ int RSA_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
int RSA_set_ex_data(RSA *r, int idx, void *arg);
void *RSA_get_ex_data(const RSA *r, int idx);
+int RSA_security_bits(const RSA *rsa);
+
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);
@@ -473,10 +475,6 @@ int RSA_meth_set_verify(RSA_METHOD *rsa, int (*verify)(int dtype,
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. */
diff --git a/code/contrib/libfido2/include/openssl/safestack.h b/code/contrib/libfido2/include/openssl/safestack.h
index e1e7e248..84853efc 100644
--- a/code/contrib/libfido2/include/openssl/safestack.h
+++ b/code/contrib/libfido2/include/openssl/safestack.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: safestack.h,v 1.21 2022/01/14 08:59:30 tb Exp $ */
+/* $OpenBSD: safestack.h,v 1.22 2022/07/16 19:11:51 kn Exp $ */
/* ====================================================================
* Copyright (c) 1999 The OpenSSL Project. All rights reserved.
*
@@ -773,6 +773,30 @@ DECLARE_SPECIAL_STACK_OF(OPENSSL_BLOCK, void)
#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))
+#ifdef LIBRESSL_INTERNAL
+#define sk_ESS_CERT_ID_V2_new(cmp) SKM_sk_new(ESS_CERT_ID_V2, (cmp))
+#define sk_ESS_CERT_ID_V2_new_null() SKM_sk_new_null(ESS_CERT_ID_V2)
+#define sk_ESS_CERT_ID_V2_free(st) SKM_sk_free(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_num(st) SKM_sk_num(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_value(st, i) SKM_sk_value(ESS_CERT_ID_V2, (st), (i))
+#define sk_ESS_CERT_ID_V2_set(st, i, val) SKM_sk_set(ESS_CERT_ID_V2, (st), (i), (val))
+#define sk_ESS_CERT_ID_V2_zero(st) SKM_sk_zero(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_push(st, val) SKM_sk_push(ESS_CERT_ID_V2, (st), (val))
+#define sk_ESS_CERT_ID_V2_unshift(st, val) SKM_sk_unshift(ESS_CERT_ID_V2, (st), (val))
+#define sk_ESS_CERT_ID_V2_find(st, val) SKM_sk_find(ESS_CERT_ID_V2, (st), (val))
+#define sk_ESS_CERT_ID_V2_find_ex(st, val) SKM_sk_find_ex(ESS_CERT_ID_V2, (st), (val))
+#define sk_ESS_CERT_ID_V2_delete(st, i) SKM_sk_delete(ESS_CERT_ID_V2, (st), (i))
+#define sk_ESS_CERT_ID_V2_delete_ptr(st, ptr) SKM_sk_delete_ptr(ESS_CERT_ID_V2, (st), (ptr))
+#define sk_ESS_CERT_ID_V2_insert(st, val, i) SKM_sk_insert(ESS_CERT_ID_V2, (st), (val), (i))
+#define sk_ESS_CERT_ID_V2_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(ESS_CERT_ID_V2, (st), (cmp))
+#define sk_ESS_CERT_ID_V2_dup(st) SKM_sk_dup(ESS_CERT_ID_V2, st)
+#define sk_ESS_CERT_ID_V2_pop_free(st, free_func) SKM_sk_pop_free(ESS_CERT_ID_V2, (st), (free_func))
+#define sk_ESS_CERT_ID_V2_shift(st) SKM_sk_shift(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_pop(st) SKM_sk_pop(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_sort(st) SKM_sk_sort(ESS_CERT_ID_V2, (st))
+#define sk_ESS_CERT_ID_V2_is_sorted(st) SKM_sk_is_sorted(ESS_CERT_ID_V2, (st))
+#endif /* LIBRESSL_INTERNAL */
+
#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))
diff --git a/code/contrib/libfido2/include/openssl/ssl.h b/code/contrib/libfido2/include/openssl/ssl.h
index e3132682..4a89bfd8 100644
--- a/code/contrib/libfido2/include/openssl/ssl.h
+++ b/code/contrib/libfido2/include/openssl/ssl.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.h,v 1.215 2021/11/01 08:14:36 tb Exp $ */
+/* $OpenBSD: ssl.h,v 1.229 2022/09/11 17:39:46 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -361,6 +361,10 @@ typedef struct ssl_method_st SSL_METHOD;
typedef struct ssl_cipher_st SSL_CIPHER;
typedef struct ssl_session_st SSL_SESSION;
+#if defined(LIBRESSL_HAS_QUIC) || defined(LIBRESSL_INTERNAL)
+typedef struct ssl_quic_method_st SSL_QUIC_METHOD;
+#endif
+
DECLARE_STACK_OF(SSL_CIPHER)
/* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
@@ -823,15 +827,18 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x);
/* 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_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
+#define SSL_ERROR_ZERO_RETURN 6
+#define SSL_ERROR_WANT_CONNECT 7
+#define SSL_ERROR_WANT_ACCEPT 8
+#define SSL_ERROR_WANT_ASYNC 9
+#define SSL_ERROR_WANT_ASYNC_JOB 10
+#define SSL_ERROR_WANT_CLIENT_HELLO_CB 11
#define SSL_CTRL_NEED_TMP_RSA 1
#define SSL_CTRL_SET_TMP_RSA 2
@@ -930,8 +937,8 @@ int PEM_write_SSL_SESSION(FILE *fp, SSL_SESSION *x);
#define SSL_CTRL_SET_GROUPS 91
#define SSL_CTRL_SET_GROUPS_LIST 92
-
-#define SSL_CTRL_SET_ECDH_AUTO 94
+#define SSL_CTRL_GET_SHARED_GROUP 93
+#define SSL_CTRL_SET_ECDH_AUTO 94
#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL)
#define SSL_CTRL_GET_PEER_SIGNATURE_NID 108
@@ -1047,6 +1054,10 @@ const SSL_METHOD *SSL_CTX_get_ssl_method(const SSL_CTX *ctx);
#define SSL_CTX_clear_extra_chain_certs(ctx) \
SSL_CTX_ctrl(ctx, SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS, 0, NULL)
+#define SSL_get_shared_group(s, n) \
+ SSL_ctrl((s), SSL_CTRL_GET_SHARED_GROUP, (n), NULL)
+#define SSL_get_shared_curve SSL_get_shared_group
+
#define SSL_get_server_tmp_key(s, pk) \
SSL_ctrl(s,SSL_CTRL_GET_SERVER_TMP_KEY,0,pk)
@@ -1507,10 +1518,289 @@ int SSL_set_session_secret_cb(SSL *s,
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.
+/* What the "other" parameter contains in security callback */
+/* Mask for type */
+#define SSL_SECOP_OTHER_TYPE 0xffff0000
+#define SSL_SECOP_OTHER_NONE 0
+#define SSL_SECOP_OTHER_CIPHER (1 << 16)
+#define SSL_SECOP_OTHER_CURVE (2 << 16)
+#define SSL_SECOP_OTHER_DH (3 << 16)
+#define SSL_SECOP_OTHER_PKEY (4 << 16)
+#define SSL_SECOP_OTHER_SIGALG (5 << 16)
+#define SSL_SECOP_OTHER_CERT (6 << 16)
+
+/* Indicated operation refers to peer key or certificate */
+#define SSL_SECOP_PEER 0x1000
+
+/* Values for "op" parameter in security callback */
+
+/* Called to filter ciphers */
+/* Ciphers client supports */
+#define SSL_SECOP_CIPHER_SUPPORTED (1 | SSL_SECOP_OTHER_CIPHER)
+/* Cipher shared by client/server */
+#define SSL_SECOP_CIPHER_SHARED (2 | SSL_SECOP_OTHER_CIPHER)
+/* Sanity check of cipher server selects */
+#define SSL_SECOP_CIPHER_CHECK (3 | SSL_SECOP_OTHER_CIPHER)
+/* Curves supported by client */
+#define SSL_SECOP_CURVE_SUPPORTED (4 | SSL_SECOP_OTHER_CURVE)
+/* Curves shared by client/server */
+#define SSL_SECOP_CURVE_SHARED (5 | SSL_SECOP_OTHER_CURVE)
+/* Sanity check of curve server selects */
+#define SSL_SECOP_CURVE_CHECK (6 | SSL_SECOP_OTHER_CURVE)
+/* Temporary DH key */
+/*
+ * XXX: changed in OpenSSL e2b420fdd70 to (7 | SSL_SECOP_OTHER_PKEY)
+ * Needs switching internal use of DH to EVP_PKEY. The code is not reachable
+ * from outside the library as long as we do not expose the callback in the API.
+ */
+#define SSL_SECOP_TMP_DH (7 | SSL_SECOP_OTHER_DH)
+/* SSL/TLS version */
+#define SSL_SECOP_VERSION (9 | SSL_SECOP_OTHER_NONE)
+/* Session tickets */
+#define SSL_SECOP_TICKET (10 | SSL_SECOP_OTHER_NONE)
+/* Supported signature algorithms sent to peer */
+#define SSL_SECOP_SIGALG_SUPPORTED (11 | SSL_SECOP_OTHER_SIGALG)
+/* Shared signature algorithm */
+#define SSL_SECOP_SIGALG_SHARED (12 | SSL_SECOP_OTHER_SIGALG)
+/* Sanity check signature algorithm allowed */
+#define SSL_SECOP_SIGALG_CHECK (13 | SSL_SECOP_OTHER_SIGALG)
+/* Used to get mask of supported public key signature algorithms */
+#define SSL_SECOP_SIGALG_MASK (14 | SSL_SECOP_OTHER_SIGALG)
+/* Use to see if compression is allowed */
+#define SSL_SECOP_COMPRESSION (15 | SSL_SECOP_OTHER_NONE)
+/* EE key in certificate */
+#define SSL_SECOP_EE_KEY (16 | SSL_SECOP_OTHER_CERT)
+/* CA key in certificate */
+#define SSL_SECOP_CA_KEY (17 | SSL_SECOP_OTHER_CERT)
+/* CA digest algorithm in certificate */
+#define SSL_SECOP_CA_MD (18 | SSL_SECOP_OTHER_CERT)
+/* Peer EE key in certificate */
+#define SSL_SECOP_PEER_EE_KEY (SSL_SECOP_EE_KEY | SSL_SECOP_PEER)
+/* Peer CA key in certificate */
+#define SSL_SECOP_PEER_CA_KEY (SSL_SECOP_CA_KEY | SSL_SECOP_PEER)
+/* Peer CA digest algorithm in certificate */
+#define SSL_SECOP_PEER_CA_MD (SSL_SECOP_CA_MD | SSL_SECOP_PEER)
+
+void SSL_set_security_level(SSL *ssl, int level);
+int SSL_get_security_level(const SSL *ssl);
+
+void SSL_CTX_set_security_level(SSL_CTX *ctx, int level);
+int SSL_CTX_get_security_level(const SSL_CTX *ctx);
+
+#if defined(LIBRESSL_HAS_QUIC) || defined(LIBRESSL_INTERNAL)
+/*
+ * QUIC integration.
+ *
+ * QUIC acts as an underlying transport for the TLS 1.3 handshake. The following
+ * functions allow a QUIC implementation to serve as the underlying transport as
+ * described in RFC 9001.
+ *
+ * When configured for QUIC, |SSL_do_handshake| will drive the handshake as
+ * before, but it will not use the configured |BIO|. It will call functions on
+ * |SSL_QUIC_METHOD| to configure secrets and send data. If data is needed from
+ * the peer, it will return |SSL_ERROR_WANT_READ|. As the caller receives data
+ * it can decrypt, it calls |SSL_provide_quic_data|. Subsequent
+ * |SSL_do_handshake| calls will then consume that data and progress the
+ * handshake. After the handshake is complete, the caller should continue to
+ * call |SSL_provide_quic_data| for any post-handshake data, followed by
+ * |SSL_process_quic_post_handshake| to process it. It is an error to call
+ * |SSL_peek|, |SSL_read| and |SSL_write| in QUIC.
+ *
+ * To avoid DoS attacks, the QUIC implementation must limit the amount of data
+ * being queued up. The implementation can call
+ * |SSL_quic_max_handshake_flight_len| to get the maximum buffer length at each
+ * encryption level.
+ *
+ * QUIC implementations must additionally configure transport parameters with
+ * |SSL_set_quic_transport_params|. |SSL_get_peer_quic_transport_params| may be
+ * used to query the value received from the peer. This extension is handled
+ * as an opaque byte string, which the caller is responsible for serializing
+ * and parsing. See RFC 9000 section 7.4 for further details.
+ */
+
+/*
+ * ssl_encryption_level_t specifies the QUIC encryption level used to transmit
+ * handshake messages.
+ */
+typedef enum ssl_encryption_level_t {
+ ssl_encryption_initial = 0,
+ ssl_encryption_early_data,
+ ssl_encryption_handshake,
+ ssl_encryption_application,
+} OSSL_ENCRYPTION_LEVEL;
+
+/*
+ * ssl_quic_method_st (aka |SSL_QUIC_METHOD|) describes custom QUIC hooks.
+ *
+ * Note that we provide both the new (BoringSSL) secrets interface
+ * (set_read_secret/set_write_secret) along with the old interface
+ * (set_encryption_secrets), which quictls is still using.
+ *
+ * Since some consumers fail to use named initialisers, the order of these
+ * functions is important. Hopefully all of these consumers use the old version.
+ */
+struct ssl_quic_method_st {
+ /*
+ * set_encryption_secrets configures the read and write secrets for the
+ * given encryption level. This function will always be called before an
+ * encryption level other than |ssl_encryption_initial| is used.
+ *
+ * When reading packets at a given level, the QUIC implementation must
+ * send ACKs at the same level, so this function provides read and write
+ * secrets together. The exception is |ssl_encryption_early_data|, where
+ * secrets are only available in the client to server direction. The
+ * other secret will be NULL. The server acknowledges such data at
+ * |ssl_encryption_application|, which will be configured in the same
+ * |SSL_do_handshake| call.
+ *
+ * This function should use |SSL_get_current_cipher| to determine the TLS
+ * cipher suite.
+ */
+ int (*set_encryption_secrets)(SSL *ssl, enum ssl_encryption_level_t level,
+ const uint8_t *read_secret, const uint8_t *write_secret,
+ size_t secret_len);
+
+ /*
+ * add_handshake_data adds handshake data to the current flight at the
+ * given encryption level. It returns one on success and zero on error.
+ * Callers should defer writing data to the network until |flush_flight|
+ * to better pack QUIC packets into transport datagrams.
+ *
+ * If |level| is not |ssl_encryption_initial|, this function will not be
+ * called before |level| is initialized with |set_write_secret|.
+ */
+ int (*add_handshake_data)(SSL *ssl, enum ssl_encryption_level_t level,
+ const uint8_t *data, size_t len);
+
+ /*
+ * flush_flight is called when the current flight is complete and should
+ * be written to the transport. Note a flight may contain data at
+ * several encryption levels. It returns one on success and zero on
+ * error.
+ */
+ int (*flush_flight)(SSL *ssl);
+
+ /*
+ * send_alert sends a fatal alert at the specified encryption level. It
+ * returns one on success and zero on error.
+ *
+ * If |level| is not |ssl_encryption_initial|, this function will not be
+ * called before |level| is initialized with |set_write_secret|.
+ */
+ int (*send_alert)(SSL *ssl, enum ssl_encryption_level_t level,
+ uint8_t alert);
+
+ /*
+ * set_read_secret configures the read secret and cipher suite for the
+ * given encryption level. It returns one on success and zero to
+ * terminate the handshake with an error. It will be called at most once
+ * per encryption level.
+ *
+ * Read keys will not be released before QUIC may use them. Once a level
+ * has been initialized, QUIC may begin processing data from it.
+ * Handshake data should be passed to |SSL_provide_quic_data| and
+ * application data (if |level| is |ssl_encryption_early_data| or
+ * |ssl_encryption_application|) may be processed according to the rules
+ * of the QUIC protocol.
+ */
+ int (*set_read_secret)(SSL *ssl, enum ssl_encryption_level_t level,
+ const SSL_CIPHER *cipher, const uint8_t *secret, size_t secret_len);
+
+ /*
+ * set_write_secret behaves like |set_read_secret| but configures the
+ * write secret and cipher suite for the given encryption level. It will
+ * be called at most once per encryption level.
+ *
+ * Write keys will not be released before QUIC may use them. If |level|
+ * is |ssl_encryption_early_data| or |ssl_encryption_application|, QUIC
+ * may begin sending application data at |level|.
+ */
+ int (*set_write_secret)(SSL *ssl, enum ssl_encryption_level_t level,
+ const SSL_CIPHER *cipher, const uint8_t *secret, size_t secret_len);
+};
+
+/*
+ * SSL_CTX_set_quic_method configures the QUIC hooks. This should only be
+ * configured with a minimum version of TLS 1.3. |quic_method| must remain valid
+ * for the lifetime of |ctx|. It returns one on success and zero on error.
+ */
+int SSL_CTX_set_quic_method(SSL_CTX *ctx, const SSL_QUIC_METHOD *quic_method);
+
+/*
+ * SSL_set_quic_method configures the QUIC hooks. This should only be
+ * configured with a minimum version of TLS 1.3. |quic_method| must remain valid
+ * for the lifetime of |ssl|. It returns one on success and zero on error.
+ */
+int SSL_set_quic_method(SSL *ssl, const SSL_QUIC_METHOD *quic_method);
+
+/* SSL_is_quic returns true if an SSL has been configured for use with QUIC. */
+int SSL_is_quic(const SSL *ssl);
+
+/*
+ * SSL_quic_max_handshake_flight_len returns returns the maximum number of bytes
+ * that may be received at the given encryption level. This function should be
+ * used to limit buffering in the QUIC implementation. See RFC 9000 section 7.5.
+ */
+size_t SSL_quic_max_handshake_flight_len(const SSL *ssl,
+ enum ssl_encryption_level_t level);
+
+/*
+ * SSL_quic_read_level returns the current read encryption level.
+ */
+enum ssl_encryption_level_t SSL_quic_read_level(const SSL *ssl);
+
+/*
+ * SSL_quic_write_level returns the current write encryption level.
*/
+enum ssl_encryption_level_t SSL_quic_write_level(const SSL *ssl);
+
+/*
+ * SSL_provide_quic_data provides data from QUIC at a particular encryption
+ * level |level|. It returns one on success and zero on error. Note this
+ * function will return zero if the handshake is not expecting data from |level|
+ * at this time. The QUIC implementation should then close the connection with
+ * an error.
+ */
+int SSL_provide_quic_data(SSL *ssl, enum ssl_encryption_level_t level,
+ const uint8_t *data, size_t len);
+
+/*
+ * SSL_process_quic_post_handshake processes any data that QUIC has provided
+ * after the handshake has completed. This includes NewSessionTicket messages
+ * sent by the server. It returns one on success and zero on error.
+ */
+int SSL_process_quic_post_handshake(SSL *ssl);
+
+/*
+ * SSL_set_quic_transport_params configures |ssl| to send |params| (of length
+ * |params_len|) in the quic_transport_parameters extension in either the
+ * ClientHello or EncryptedExtensions handshake message. It is an error to set
+ * transport parameters if |ssl| is not configured for QUIC. The buffer pointed
+ * to by |params| only need be valid for the duration of the call to this
+ * function. This function returns 1 on success and 0 on failure.
+ */
+int SSL_set_quic_transport_params(SSL *ssl, const uint8_t *params,
+ size_t params_len);
+
+/*
+ * SSL_get_peer_quic_transport_params provides the caller with the value of the
+ * quic_transport_parameters extension sent by the peer. A pointer to the buffer
+ * containing the TransportParameters will be put in |*out_params|, and its
+ * length in |*params_len|. This buffer will be valid for the lifetime of the
+ * |SSL|. If no params were received from the peer, |*out_params_len| will be 0.
+ */
+void SSL_get_peer_quic_transport_params(const SSL *ssl,
+ const uint8_t **out_params, size_t *out_params_len);
+
+/*
+ * SSL_set_quic_use_legacy_codepoint configures whether to use the legacy QUIC
+ * extension codepoint 0xffa5 as opposed to the official value 57. This is
+ * unsupported in LibreSSL.
+ */
+void SSL_set_quic_use_legacy_codepoint(SSL *ssl, int use_legacy);
+
+#endif
+
void ERR_load_SSL_strings(void);
/* Error codes for the SSL functions. */
@@ -1787,6 +2077,8 @@ void ERR_load_SSL_strings(void);
#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_CA_KEY_TOO_SMALL 397
+#define SSL_R_CA_MD_TOO_WEAK 398
#define SSL_R_CCS_RECEIVED_EARLY 133
#define SSL_R_CERTIFICATE_VERIFY_FAILED 134
#define SSL_R_CERT_LENGTH_MISMATCH 135
@@ -1808,6 +2100,7 @@ void ERR_load_SSL_strings(void);
#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_KEY_TOO_SMALL 394
#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
@@ -1817,6 +2110,7 @@ void ERR_load_SSL_strings(void);
#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_EE_KEY_TOO_SMALL 399
#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
@@ -2031,6 +2325,7 @@ void ERR_load_SSL_strings(void);
#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_VERSION_TOO_LOW 396
#define SSL_R_WRITE_BIO_NOT_SET 260
#define SSL_R_WRONG_CIPHER_RETURNED 261
#define SSL_R_WRONG_CURVE 378
@@ -2044,6 +2339,8 @@ void ERR_load_SSL_strings(void);
#define SSL_R_X509_LIB 268
#define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269
#define SSL_R_PEER_BEHAVING_BADLY 666
+#define SSL_R_QUIC_INTERNAL_ERROR 667
+#define SSL_R_WRONG_ENCRYPTION_LEVEL_RECEIVED 668
#define SSL_R_UNKNOWN 999
/*
diff --git a/code/contrib/libfido2/include/openssl/tls1.h b/code/contrib/libfido2/include/openssl/tls1.h
index 547fb86e..2bdbd3c1 100644
--- a/code/contrib/libfido2/include/openssl/tls1.h
+++ b/code/contrib/libfido2/include/openssl/tls1.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls1.h,v 1.51 2022/02/05 18:18:18 tb Exp $ */
+/* $OpenBSD: tls1.h,v 1.56 2022/07/17 14:39:09 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -159,6 +159,8 @@
extern "C" {
#endif
+#define OPENSSL_TLS_SECURITY_LEVEL 1
+
#define TLS1_ALLOW_EXPERIMENTAL_CIPHERSUITES 0
#if defined(LIBRESSL_HAS_TLS1_3) || defined(LIBRESSL_INTERNAL)
@@ -270,6 +272,11 @@ extern "C" {
#define TLSEXT_TYPE_key_share 51
#endif
+/* ExtensionType value from RFC 9001 section 8.2 */
+#if defined(LIBRESSL_HAS_QUIC) || defined(LIBRESSL_INTERNAL)
+#define TLSEXT_TYPE_quic_transport_parameters 57
+#endif
+
/*
* TLS 1.3 extension names from OpenSSL, where they decided to use a different
* name from that given in RFC 8446.
diff --git a/code/contrib/libfido2/include/openssl/ts.h b/code/contrib/libfido2/include/openssl/ts.h
index fa8eb949..cb372e66 100644
--- a/code/contrib/libfido2/include/openssl/ts.h
+++ b/code/contrib/libfido2/include/openssl/ts.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ts.h,v 1.10 2018/05/13 15:35:46 tb Exp $ */
+/* $OpenBSD: ts.h,v 1.19 2022/09/11 17:31:19 tb Exp $ */
/* Written by Zoltan Glozik (zglozik@opentsa.org) for the OpenSSL
* project 2002, 2003, 2004.
*/
@@ -93,99 +93,12 @@ extern "C" {
#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. */
+typedef struct TS_msg_imprint_st TS_MSG_IMPRINT;
+typedef struct TS_req_st TS_REQ;
+typedef struct TS_accuracy_st TS_ACCURACY;
+typedef struct TS_tst_info_st TS_TST_INFO;
+/* Possible values for status. */
#define TS_STATUS_GRANTED 0
#define TS_STATUS_GRANTED_WITH_MODS 1
#define TS_STATUS_REJECTION 2
@@ -193,8 +106,7 @@ PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
#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 */
-
+/* Possible values for failure_info. */
#define TS_INFO_BAD_ALG 0
#define TS_INFO_BAD_REQUEST 2
#define TS_INFO_BAD_DATA_FORMAT 5
@@ -204,66 +116,21 @@ PKIFreeText ::= SEQUENCE SIZE (1..MAX) OF UTF8String
#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;
+typedef struct TS_status_info_st 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;
-
+typedef struct ESS_issuer_serial ESS_ISSUER_SERIAL;
+typedef struct ESS_cert_id ESS_CERT_ID;
DECLARE_STACK_OF(ESS_CERT_ID)
+typedef struct ESS_signing_cert ESS_SIGNING_CERT;
-/*
-SigningCertificate ::= SEQUENCE {
- certs SEQUENCE OF ESSCertID,
- policies SEQUENCE OF PolicyInformation OPTIONAL
-}
-*/
+typedef struct ESS_cert_id_v2 ESS_CERT_ID_V2;
+DECLARE_STACK_OF(ESS_CERT_ID_V2)
-typedef struct ESS_signing_cert {
- STACK_OF(ESS_CERT_ID) *cert_ids;
- STACK_OF(POLICYINFO) *policy_info;
-} ESS_SIGNING_CERT;
+typedef struct ESS_signing_cert_v2 ESS_SIGNING_CERT_V2;
+typedef struct TS_resp_st TS_RESP;
TS_REQ *TS_REQ_new(void);
void TS_REQ_free(TS_REQ *a);
@@ -351,8 +218,6 @@ 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);
@@ -389,11 +254,17 @@ void *TS_REQ_get_ext_d2i(TS_REQ *a, int nid, int *crit, int *idx);
int TS_REQ_print_bio(BIO *bio, TS_REQ *a);
-/* Function declarations for TS_RESP defined in ts/ts_resp_utils.c */
+/* Function declarations for TS_RESP defined in ts/ts_rsp_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);
+const ASN1_UTF8STRING *TS_STATUS_INFO_get0_failure_info(const TS_STATUS_INFO *si);
+const STACK_OF(ASN1_UTF8STRING) *
+ TS_STATUS_INFO_get0_text(const TS_STATUS_INFO *si);
+const ASN1_INTEGER *TS_STATUS_INFO_get0_status(const TS_STATUS_INFO *si);
+int TS_STATUS_INFO_set_status(TS_STATUS_INFO *si, int i);
+
/* 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);
@@ -447,7 +318,7 @@ 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. */
+/* Declarations related to response generation, defined in ts/ts_rsp_sign.c. */
/* Optional flags for response generation. */
@@ -482,35 +353,7 @@ typedef int (*TS_time_cb)(struct TS_resp_ctx *, void *, time_t *sec, long *usec)
*/
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;
+typedef struct TS_resp_ctx TS_RESP_CTX;
DECLARE_STACK_OF(EVP_MD)
@@ -555,6 +398,9 @@ 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 uses gettimeofday() and gmtime(). */
+void TS_RESP_CTX_set_time_cb(TS_RESP_CTX *ctx, TS_time_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. */
@@ -585,7 +431,7 @@ 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.
+ * they are defined in ts/ts_rsp_verify.c.
*/
int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
@@ -629,32 +475,7 @@ int TS_RESP_verify_signature(PKCS7 *token, STACK_OF(X509) *certs,
| 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;
+typedef struct TS_verify_ctx 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);
@@ -670,6 +491,17 @@ 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);
+int TS_VERIFY_CTX_add_flags(TS_VERIFY_CTX *ctx, int flags);
+int TS_VERIFY_CTX_set_flags(TS_VERIFY_CTX *ctx, int flags);
+BIO *TS_VERIFY_CTX_set_data(TS_VERIFY_CTX *ctx, BIO *bio);
+X509_STORE *TS_VERIFY_CTX_set_store(TS_VERIFY_CTX *ctx, X509_STORE *store);
+/* R$ special */
+#define TS_VERIFY_CTS_set_certs TS_VERIFY_CTX_set_certs
+STACK_OF(X509) *TS_VERIFY_CTX_set_certs(TS_VERIFY_CTX *ctx,
+ STACK_OF(X509) *certs);
+unsigned char *TS_VERIFY_CTX_set_imprint(TS_VERIFY_CTX *ctx,
+ unsigned char *imprint, long imprint_len);
+
/*
* If ctx is NULL, it allocates and returns a new object, otherwise
* it returns ctx. It initialises all the members as follows:
@@ -682,13 +514,13 @@ void TS_VERIFY_CTX_cleanup(TS_VERIFY_CTX *ctx);
* 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)
+ * 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 */
+/* Function declarations for TS_RESP defined in ts/ts_rsp_print.c */
int TS_RESP_print_bio(BIO *bio, TS_RESP *a);
int TS_STATUS_INFO_print_bio(BIO *bio, TS_STATUS_INFO *a);
@@ -732,11 +564,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/ui.h b/code/contrib/libfido2/include/openssl/ui.h
index 5ca65b0a..7755cf4a 100644
--- a/code/contrib/libfido2/include/openssl/ui.h
+++ b/code/contrib/libfido2/include/openssl/ui.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ui.h,v 1.12 2020/09/24 19:20:32 tb Exp $ */
+/* $OpenBSD: ui.h,v 1.14 2022/07/12 18:43:56 jsing Exp $ */
/* Written by Richard Levitte (richard@levitte.org) for the OpenSSL
* project 2001.
*/
@@ -371,11 +371,6 @@ int UI_UTIL_read_pw_string(char *buf, int length, const char *prompt,
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. */
diff --git a/code/contrib/libfido2/include/openssl/x509.h b/code/contrib/libfido2/include/openssl/x509.h
index 05872e1a..bac1341a 100644
--- a/code/contrib/libfido2/include/openssl/x509.h
+++ b/code/contrib/libfido2/include/openssl/x509.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509.h,v 1.89 2022/01/10 14:13:03 tb Exp $ */
+/* $OpenBSD: x509.h,v 1.90 2022/07/12 14:42:50 kn Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -1136,10 +1136,6 @@ 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. */
diff --git a/code/contrib/libfido2/include/openssl/x509_vfy.h b/code/contrib/libfido2/include/openssl/x509_vfy.h
index 9a649cbb..98b1cf5e 100644
--- a/code/contrib/libfido2/include/openssl/x509_vfy.h
+++ b/code/contrib/libfido2/include/openssl/x509_vfy.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_vfy.h,v 1.50 2022/01/14 07:53:45 tb Exp $ */
+/* $OpenBSD: x509_vfy.h,v 1.54 2022/07/07 13:01:28 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -205,6 +205,11 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth);
/* Issuer lookup error */
#define X509_V_ERR_STORE_LOOKUP 66
+/* Security level errors */
+#define X509_V_ERR_EE_KEY_TOO_SMALL 67
+#define X509_V_ERR_CA_KEY_TOO_SMALL 68
+#define X509_V_ERR_CA_MD_TOO_WEAK 69
+
/* Certificate verify flags */
/* Send issuer+subject checks to verify_cb */
@@ -426,6 +431,8 @@ 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_auth_level(X509_VERIFY_PARAM *param, int auth_level);
+time_t X509_VERIFY_PARAM_get_time(const X509_VERIFY_PARAM *param);
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);
diff --git a/code/contrib/libfido2/include/openssl/x509v3.h b/code/contrib/libfido2/include/openssl/x509v3.h
index c82ecae0..2bc87f60 100644
--- a/code/contrib/libfido2/include/openssl/x509v3.h
+++ b/code/contrib/libfido2/include/openssl/x509v3.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509v3.h,v 1.14 2022/01/14 09:01:36 tb Exp $ */
+/* $OpenBSD: x509v3.h,v 1.15 2022/07/12 14:42:50 kn Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 1999.
*/
@@ -1036,10 +1036,6 @@ int X509v3_addr_validate_resource_set(STACK_OF(X509) *chain, IPAddrBlocks *ext,
#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. */
diff --git a/code/contrib/libfido2/include/zconf.h b/code/contrib/libfido2/include/zconf.h
index 352f552b..2271dc5f 100644
--- a/code/contrib/libfido2/include/zconf.h
+++ b/code/contrib/libfido2/include/zconf.h
@@ -40,6 +40,9 @@
# define crc32 z_crc32
# define crc32_combine z_crc32_combine
# define crc32_combine64 z_crc32_combine64
+# define crc32_combine_gen z_crc32_combine_gen
+# define crc32_combine_gen64 z_crc32_combine_gen64
+# define crc32_combine_op z_crc32_combine_op
# define crc32_z z_crc32_z
# define deflate z_deflate
# define deflateBound z_deflateBound
@@ -351,6 +354,9 @@
# ifdef FAR
# undef FAR
# endif
+# ifndef WIN32_LEAN_AND_MEAN
+# define WIN32_LEAN_AND_MEAN
+# endif
# include
/* No need for _export, use ZLIB.DEF instead. */
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
@@ -469,11 +475,18 @@ typedef uLong FAR uLongf;
# undef _LARGEFILE64_SOURCE
#endif
-#if defined(__WATCOMC__) && !defined(Z_HAVE_UNISTD_H)
-# define Z_HAVE_UNISTD_H
+#ifndef Z_HAVE_UNISTD_H
+# ifdef __WATCOMC__
+# define Z_HAVE_UNISTD_H
+# endif
+#endif
+#ifndef Z_HAVE_UNISTD_H
+# if defined(_LARGEFILE64_SOURCE) && !defined(_WIN32)
+# define Z_HAVE_UNISTD_H
+# endif
#endif
#ifndef Z_SOLO
-# if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE)
+# if defined(Z_HAVE_UNISTD_H)
# include /* for SEEK_*, off_t, and _LFS64_LARGEFILE */
# ifdef VMS
# include /* for off_t */
diff --git a/code/contrib/libfido2/include/zlib.h b/code/contrib/libfido2/include/zlib.h
index 4a98e38b..953cb501 100644
--- a/code/contrib/libfido2/include/zlib.h
+++ b/code/contrib/libfido2/include/zlib.h
@@ -1,5 +1,5 @@
/* zlib.h -- interface of the 'zlib' general purpose compression library
- version 1.2.12, March 11th, 2022
+ version 1.2.13, October 13th, 2022
Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler
@@ -37,11 +37,11 @@
extern "C" {
#endif
-#define ZLIB_VERSION "1.2.12"
-#define ZLIB_VERNUM 0x12c0
+#define ZLIB_VERSION "1.2.13"
+#define ZLIB_VERNUM 0x12d0
#define ZLIB_VER_MAJOR 1
#define ZLIB_VER_MINOR 2
-#define ZLIB_VER_REVISION 12
+#define ZLIB_VER_REVISION 13
#define ZLIB_VER_SUBREVISION 0
/*
@@ -276,7 +276,7 @@ ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush));
== 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
+ which can be used if desired to determine whether or not there is more output
in that case.
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to
@@ -660,7 +660,7 @@ ZEXTERN int ZEXPORT deflateGetDictionary OF((z_streamp strm,
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.
+ Similarly, 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
@@ -915,7 +915,7 @@ ZEXTERN int ZEXPORT inflateGetDictionary OF((z_streamp strm,
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.
+ Similarly, 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.
@@ -1437,12 +1437,12 @@ ZEXTERN z_size_t ZEXPORT gzfread OF((voidp buf, z_size_t size, z_size_t nitems,
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
+ multiple of size, then the final partial item is nevertheless 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.
+ file, resetting and retrying on end-of-file, when size is not 1.
*/
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, voidpc buf, unsigned len));
@@ -1913,7 +1913,7 @@ 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 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)
diff --git a/code/contrib/libfido2/lib/x64/cbor.lib b/code/contrib/libfido2/lib/x64/cbor.lib
index 039c145f..a1169bf4 100644
Binary files a/code/contrib/libfido2/lib/x64/cbor.lib 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
deleted file mode 100644
index a04e3e00..00000000
Binary files a/code/contrib/libfido2/lib/x64/crypto-49.lib and /dev/null differ
diff --git a/code/contrib/libfido2/lib/x64/fido2.lib b/code/contrib/libfido2/lib/x64/fido2.lib
index f5f38e35..1b365f55 100644
Binary files a/code/contrib/libfido2/lib/x64/fido2.lib 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
index 07e4b106..094891d7 100644
Binary files a/code/contrib/libfido2/lib/x64/zlib1.lib and b/code/contrib/libfido2/lib/x64/zlib1.lib differ
diff --git a/code/crypto/hmac.c b/code/crypto/hmac.c
index adeccd29..cc255829 100644
--- a/code/crypto/hmac.c
+++ b/code/crypto/hmac.c
@@ -160,6 +160,22 @@ static const char *hmac_text_name(ssh2_mac *mac)
return ctx->text_name->s;
}
+static const struct hmac_extra ssh_hmac_sha512_extra = { &ssh_sha512, "" };
+const ssh2_macalg ssh_hmac_sha512 = {
+ .new = hmac_new,
+ .free = hmac_free,
+ .setkey = hmac_key,
+ .start = hmac_start,
+ .genresult = hmac_genresult,
+ .next_message = nullmac_next_message,
+ .text_name = hmac_text_name,
+ .name = "hmac-sha2-512",
+ .etm_name = "hmac-sha2-512-etm@openssh.com",
+ .len = 64,
+ .keylen = 64,
+ .extra = &ssh_hmac_sha512_extra,
+};
+
static const struct hmac_extra ssh_hmac_sha256_extra = { &ssh_sha256, "" };
const ssh2_macalg ssh_hmac_sha256 = {
.new = hmac_new,
diff --git a/code/crypto/openssh-certs.c b/code/crypto/openssh-certs.c
index cf0c2af3..4cd984e8 100644
--- a/code/crypto/openssh-certs.c
+++ b/code/crypto/openssh-certs.c
@@ -1033,12 +1033,14 @@ static bool opensshcert_check_cert(
*/
if (time < ck->valid_after) {
put_fmt(error, "Certificate is not valid until ");
- opensshcert_time_to_iso8601(BinarySink_UPCAST(error), time);
+ opensshcert_time_to_iso8601(BinarySink_UPCAST(error),
+ ck->valid_after);
goto out;
}
if (time >= ck->valid_before) {
put_fmt(error, "Certificate expired at ");
- opensshcert_time_to_iso8601(BinarySink_UPCAST(error), time);
+ opensshcert_time_to_iso8601(BinarySink_UPCAST(error),
+ ck->valid_before);
goto out;
}
diff --git a/code/doc/CMakeLists.txt b/code/doc/CMakeLists.txt
index 79b1ba1f..293cd6f1 100644
--- a/code/doc/CMakeLists.txt
+++ b/code/doc/CMakeLists.txt
@@ -109,6 +109,13 @@ if(HALIBUT AND PERL_EXECUTABLE)
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${manual_sources} ${manual_dependencies})
list(APPEND doc_outputs puttydoc.txt)
+
+ # PDF. (We don't ship this; so it's only built on explicit request.)
+ add_custom_command(OUTPUT putty.pdf
+ COMMAND ${HALIBUT} --pdf ${manual_sources}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ DEPENDS ${manual_sources} ${manual_dependencies})
+ add_custom_target(pdf DEPENDS putty.pdf)
endif()
macro(register_manpage title section)
diff --git a/code/doc/blurb.but b/code/doc/blurb.but
index c68a6262..84105d0f 100644
--- a/code/doc/blurb.but
+++ b/code/doc/blurb.but
@@ -23,6 +23,7 @@ page.
}
\cfg{winhelp-filename}{putty.hlp}
\cfg{info-filename}{putty.info}
\cfg{chm-filename}{putty.chm}
+\cfg{pdf-filename}{putty.pdf}
PuTTY is a free (MIT-licensed) Windows Telnet and SSH client. This
manual documents PuTTY, and its companion utilities PSCP, PSFTP,
diff --git a/code/doc/config.but b/code/doc/config.but
index f258a356..8b3191fa 100644
--- a/code/doc/config.but
+++ b/code/doc/config.but
@@ -214,12 +214,15 @@ digits.
\b \c{&T} will be replaced by the current time, as six digits
(HHMMSS) with no punctuation.
-\b \c{&H} will be replaced by the host name you are connecting to.
+\b \c{&H} will be replaced by the host name you are connecting to
+(or the serial line, for a serial connection).
\b \c{&P} will be replaced by the port number you are connecting to on
the target host.
-For example, if you enter the host name
+(These are all case-insensitive.)
+
+For example, if you enter the file name
\c{c:\\puttylogs\\log-&h-&y&m&d-&t.dat}, you will end up with files looking
like
@@ -3030,6 +3033,9 @@ PuTTY can't fall back to using this file itself.
\S{config-ssh-cert} \q{\ii{Certificate} to use with the private key}
+(This is optional. If you don't know you need it, you can leave this
+blank.)
+
In some environments, user authentication keys can be signed in turn
by a \q{certifying authority} (\q{CA} for short), and user accounts on
an SSH server can be configured to automatically trust any key that's
@@ -3521,6 +3527,9 @@ 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.)
+(The PuTTY project has a defined policy about when we're prepared to
+add auto-detection for a bug workaround. See \k{feedback-workarounds}.)
+
\S{config-ssh-bug-ignore2} \q{Chokes on SSH-2 \i{ignore message}s}
An ignore message (SSH_MSG_IGNORE) is a message in the SSH protocol
@@ -3661,6 +3670,23 @@ connection would deadlock. We don't know of any servers that do this,
but if there is one, then this flag will make PuTTY unable to speak to
them at all.
+\S{config-ssh-bug-rsa-sha2-cert-userauth} \q{Old RSA/SHA2 cert
+algorithm naming}
+
+If PuTTY is trying to do SSH-2 user authentication using an RSA key,
+and the server is using one of the newer SHA-2 based versions of the
+SSH RSA protocol, and the user's key is also a certificate, then
+earlier versions of OpenSSH (up to 7.7) disagree with later versions
+about the right key algorithm string to send in the
+\cw{SSH2_MSG_USERAUTH_REQUEST} packet. Modern versions send a string
+that indicates both the SHA-2 nature and the certificate nature of the
+key, such as \cq{rsa-sha2-512-cert-v01@openssh.com}. Earlier versions
+would reject that, and insist on seeing
+\cq{ssh-rsa-cert-v01@openssh.com} followed by a SHA-2 based signature.
+
+PuTTY should auto-detect the presence of this bug in earlier OpenSSH
+and adjust to send the right string.
+
\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
@@ -4071,7 +4097,7 @@ at the bottom of the screen, until a space is typed.
\S{supdup-scroll} \q{Terminal scrolling}
-This controls whether the terminal will perform scrolling then the
+This controls whether the terminal will perform scrolling when the
cursor goes below the last line, or if the cursor will return to the
first line.
diff --git a/code/doc/errors.but b/code/doc/errors.but
index a35a7256..ca1a53e0 100644
--- a/code/doc/errors.but
+++ b/code/doc/errors.but
@@ -374,6 +374,10 @@ Check that you are connecting with the correct protocol (SSH, Telnet,
etc), and check that the port number is correct. If that
fails, consult the administrator of your server.
+This error can also be caused by a firewall in between you and the
+server, which rejects the connection and sends back the same type of
+error packet as the real server would have sent.
+
\H{errors-conntimedout} \q{Network error: Connection timed out}
This error means that the network connection PuTTY tried to make to
diff --git a/code/doc/faq.but b/code/doc/faq.but
index 9a8deea2..61d2a5a2 100644
--- a/code/doc/faq.but
+++ b/code/doc/faq.but
@@ -1084,6 +1084,24 @@ sending of the \cw{IUTF8} mode: on the SSH / TTY panel, select
\cw{IUTF8} on the list, select \q{Nothing}, and press \q{Set}. (It's
not possible to disable sending this mode in 0.68.)
+\S{faq-privkey-control-moved}{Question} Since 0.78, I can't find where
+to configure my SSH private key.
+
+In PuTTY 0.78, the \q{\ii{Private key} file for authentication} control,
+where you specify a \c{.\i{PPK}} file for SSH public key authentication,
+moved to a new \q{Credentials} panel in the configuration dialog. You can
+find this by opening the \q{SSH} category in the tree view on the left,
+then opening the \q{Auth} subcategory under that, then clicking on
+\q{Credentials}. On this page you'll find the \q{Browse...} button you
+need to select a \c{.PPK} file for authentication, as described in
+\k{config-ssh-privkey}.
+
+(This control had previously been on the \q{Auth} panel since public
+key authentication was first released in 2002, so many online how-to
+guides still describe it there. The configuration controls were
+reorganised to make room for features added in 0.78, such as OpenSSH
+certificates.)
+
\H{faq-secure} Security questions
\S{faq-publicpc}{Question} Is it safe for me to download PuTTY and
diff --git a/code/doc/feedback.but b/code/doc/feedback.but
index b7aa9c87..d4f58c09 100644
--- a/code/doc/feedback.but
+++ b/code/doc/feedback.but
@@ -297,6 +297,54 @@ high-quality software to the users comes first.)
way to get a feature implemented quickly, if it's a big one that we
don't have time to do ourselves.
+\H{feedback-workarounds} Workarounds for SSH server bugs
+
+It's normal for SSH implementations to automatically enable
+workarounds for each other's bugs, using the software version strings
+that are exchanged at the start of the connection. Typically an SSH
+client will have a list of server version strings that it believes to
+have particular bugs, and auto-enable the appropriate set of
+workarounds when it sees one of those strings. (And servers will have
+a similar list of workarounds for \e{client} software they believe to
+be buggy.)
+
+If you've found a bug in an SSH server, and you'd like us to add an
+auto-detected workaround for it, our policy is that \s{the server
+implementor should fix it first}.
+
+If the server implementor has fixed it in the latest version, and can
+give us a complete description of the version strings that go with the
+bug, then we're happy to use those version strings as a trigger to
+automatically enable our workaround (assuming one is possible). We
+\e{won't} accept requests to auto-enable workarounds for an open-ended
+set of version strings, such as \q{any version of FooServer, including
+future ones not yet released}.
+
+The aim of this policy is to encourage implementors to gradually
+converge on the actual standardised SSH protocol. If we enable people
+to continue violating the spec, by installing open-ended workarounds
+in PuTTY for bugs they're never going to fix, then we're contributing
+to an ecosystem in which everyone carries on having bugs and everyone
+else carries on having to work around them.
+
+An exception: if an SSH server is no longer maintained \e{at all}
+(e.g. the company that produced it has gone out of business), and
+every version of it that was ever released has a bug, then that's one
+situation in which we may be prepared to add a workaround rule that
+matches all versions of that software. (The aim is to stop
+implementors from continuing to release software with the bug \dash
+and if they're not releasing it \e{at all} any more, then that's
+already done!)
+
+We do recognise that sometimes it will be difficult to get the server
+maintainer to fix a bug, or even to answer support requests at all. Or
+it might take them a very long time to get round to doing anything
+about it. We're not completely unwilling to compromise: we're prepared
+to add \e{manually enabled} workarounds to PuTTY even for bugs that an
+implementation hasn't fixed yet. We just won't \e{automatically}
+enable the workaround unless the server maintainer has also done their
+part.
+
\H{feedback-support} \ii{Support requests}
If you're trying to make PuTTY do something for you and it isn't
diff --git a/code/doc/html/AppendixA.html b/code/doc/html/AppendixA.html
index 0ab11040..1a6b9905 100644
--- a/code/doc/html/AppendixA.html
+++ b/code/doc/html/AppendixA.html
@@ -96,6 +96,7 @@
A.7.21 PuTTY fails to start up. Windows claims that ‘the application configuration is incorrect’.
A.7.22 When I put 32-bit PuTTY in C:\WINDOWS\SYSTEM32
on my 64-bit Windows system, ‘Duplicate Session’ doesn't work.
A.7.23 After I upgraded PuTTY to 0.68, I can no longer connect to my embedded device or appliance.
+A.7.24 Since 0.78, I can't find where to configure my SSH private key.
A.8 Security questions
@@ -758,6 +759,13 @@ A.7.23 After I upgraded PuTTY
If you think you have such a server, from 0.69 onwards you can disable sending of the IUTF8
mode: on the SSH / TTY panel, select IUTF8
on the list, select ‘Nothing’, and press ‘Set’. (It's not possible to disable sending this mode in 0.68.)
+A.7.24 Since 0.78, I can't find where to configure my SSH private key.
+
+In PuTTY 0.78, the ‘Private key file for authentication’ control, where you specify a .PPK
file for SSH public key authentication, moved to a new ‘Credentials’ panel in the configuration dialog. You can find this by opening the ‘SSH’ category in the tree view on the left, then opening the ‘Auth’ subcategory under that, then clicking on ‘Credentials’. On this page you'll find the ‘Browse...’ button you need to select a .PPK
file for authentication, as described in section 4.22.1.
+
+
+(This control had previously been on the ‘Auth’ panel since public key authentication was first released in 2002, so many online how-to guides still describe it there. The configuration controls were reorganised to make room for features added in 0.78, such as OpenSSH certificates.)
+
A.8 Security questions
A.8.1 Is it safe for me to download PuTTY and use it on a public PC?
@@ -766,17 +774,17 @@
A.8.1 Is it safe for me to d
If you do trust the PC, then it's probably OK to use PuTTY on it (but if you don't trust the network, then the PuTTY download might be tampered with, so it would be better to carry PuTTY with you on a USB stick).
-A.8.2 What does PuTTY leave on a system? How can I clean up after it?
+A.8.2 What does PuTTY leave on a system? How can I clean up after it?
PuTTY will leave some Registry entries, and a random seed file, on the PC (see question A.5.2). Windows 7 and up also remember some information about recently launched sessions for the ‘jump list’ feature.
-If you are using PuTTY on a public PC, or somebody else's PC, you might want to clean this information up when you leave. You can do that automatically, by running the command putty -cleanup
. See section 3.11.2 in the documentation for more detail. (Note that this only removes settings for the currently logged-in user on multi-user systems.)
+If you are using PuTTY on a public PC, or somebody else's PC, you might want to clean this information up when you leave. You can do that automatically, by running the command putty -cleanup
. See section 3.11.2 in the documentation for more detail. (Note that this only removes settings for the currently logged-in user on multi-user systems.)
If PuTTY was installed from the installer package, it will also appear in ‘Add/Remove Programs’. Current versions of the installer do not offer to remove the above-mentioned items, so if you want them removed you should run putty -cleanup
before uninstalling.
-A.8.3 How come PuTTY now supports DSA, when the website used to say how insecure it was?
+A.8.3 How come PuTTY now supports DSA, when the website used to say how insecure it was?
DSA has a major weakness if badly implemented: it relies on a random number generator to far too great an extent. If the random number generator produces a number an attacker can predict, the DSA private key is exposed - meaning that the attacker can log in as you on all systems that accept that key.
@@ -790,7 +798,7 @@ A.8.4 Couldn't Pageant us
Unfortunately not. The VirtualLock()
function in the Windows API doesn't do a proper job: it may prevent small pieces of a process's memory from being paged to disk while the process is running, but it doesn't stop the process's memory as a whole from being swapped completely out to disk when the process is long-term inactive. And Pageant spends most of its time inactive.
-A.8.5 Is the version of PuTTY in the Microsoft Store legit?
+A.8.5 Is the version of PuTTY in the Microsoft Store legit?
The free-of-charge ‘PuTTY’ application at this link is published and maintained by us. The copy there is the latest release, usually updated within a few days of us publishing it on our own website.
@@ -871,7 +879,7 @@ A.9.9 Can I have permissio
Yes. For most things, you need not bother asking us explicitly for permission; our licence already grants you permission.
-See section B.8 for more details.
+See section B.9 for more details.
A.9.10 Can you sign an agreement indemnifying us against security problems in PuTTY?
@@ -994,7 +1002,7 @@
A.9.17 The sha1sums<
A.10 Miscellaneous questions
-A.10.1 Is PuTTY a port of OpenSSH, or based on OpenSSH or OpenSSL?
+A.10.1 Is PuTTY a port of OpenSSH, or based on OpenSSH or OpenSSL?
No, it isn't. PuTTY is almost completely composed of code written from scratch for PuTTY. The only code we share with OpenSSH is the detector for SSH-1 CRC compensation attacks, written by CORE SDI S.A; we share no code at all with OpenSSL.
@@ -1015,5 +1023,5 @@ A.10.4 How do I pronounce
If you want to provide feedback on this manual or on the PuTTY tools themselves, see the Feedback page.
-[PuTTY release 0.78]