Changes In Branch tls-1-3-io-rewrite Excluding Merge-Ins
This is equivalent to a diff from c7d3de2764 to 5ed815df85
2000-07-26
| ||
23:11 | * tests/tlsIO.test: updated comments, fixed a pcCrash case that was due to debug assertion in Windows SSL. Closed-Leaf check-in: 5ed815df85 user: hobbs tags: merge-1-3-io-rewrite-07-26-00, tls-1-3-io-rewrite | |
22:15 | * tls.c (ImportObjCmd): removed unnecessary use of 'bio' arg. (Tls_Init): check return value of SSL_library_init. Also lots of whitespace cleanup (more like Tcl Eng style guide), but not all code was cleaned up. * tlsBIO.c: minor whitespace cleanup * tlsIO.c: minor whitespace cleanup. (TlsInputProc, TlsOutputProc): Added ERR_clear_error before calls to BIO_read or BIO_write, because we could otherwise end up pulling an error off the stack that didn't belong to us. Also cleanup up excessive use of gotos. check-in: e64e21d80e user: hobbs tags: tls-1-3-io-rewrite | |
2000-07-20
| ||
02:44 | Use INSTALL_PROGRAM instead of INSTALL_DATA when installing libraries on hpux so that the libraries get execute permission. check-in: 2b4dc4cee0 user: wart tags: trunk | |
2000-07-11
| ||
04:58 | * tlsBIO.c (BioWrite, BioRead): changed Tcl_Read/Write to Tcl_ReadRaw/TclWriteRaw. * tls.c: added use of Tcl_GetTopChannel after Tcl_GetChannel and got return value from Tcl_StackChannel. * tests/tlsIO.test: added some handshaking that shouldn't be necessary, but we crash otherwise (needs more testing). * tlsIO.c: added support for "corrected" stacked channels. All the above channels are in TCL_CHANNEL_VERSION_2 #ifdefs. check-in: fb9a612600 user: hobbs tags: tls-1-3-io-rewrite | |
2000-06-28
| ||
18:24 | Added HPUX to list of known platforms. check-in: c7d3de2764 user: wart tags: trunk | |
2000-06-21
| ||
21:00 | Changed name of test variable from TCLTESTARGS to TESTFLAGS check-in: b9eeeb6baa user: wart tags: trunk | |
Modified ChangeLog
from [cd26bc6332]
to [109956acd8].
|
Modified Makefile.in
from [43741953a5]
to [a26a065317].
︙ | |||
8 9 10 11 12 13 14 | 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | - + | # # Copyright (c) 1999-2000 Ajuba Solutions. # All rights reserved. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # |
︙ | |||
91 92 93 94 95 96 97 98 99 100 101 102 103 104 | 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | + | libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = RELPATH = @RELPATH@ pkgdatadir = $(datadir)/@PACKAGE@@VERSION@ pkglibdir = $(libdir)/@PACKAGE@@VERSION@ pkgincludedir = $(includedir)/@PACKAGE@@VERSION@ top_builddir = . |
︙ | |||
206 207 208 209 210 211 212 213 214 215 216 217 218 219 | 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 | + + + | libraries: $(tls_SCRIPT_FILES) doc: install: all install-binaries install-libraries install-doc install-binaries: binaries install-lib-binaries install-bin-binaries sed -e "s#\@RELPATH\@#$(RELPATH)#" \ -e "s#\@tls_LIB_FILE\@#$(tls_LIB_FILE)#" \ < $(srcdir)/pkgIndex.tcl.in > pkgIndex.tcl $(INSTALL_DATA) pkgIndex.tcl $(pkglibdir) #======================================================================== # This rule installs platform-independent files, such as header files. #======================================================================== install-libraries: libraries |
︙ |
Modified configure.in
from [b7f03645a1]
to [f7106cacc4].
︙ | |||
30 31 32 33 34 35 36 | 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 | - + | # like dots in # library names (Windows). The VERSION variable is # used on the other systems. #-------------------------------------------------------------------- PACKAGE=tls MAJOR_VERSION=1 |
︙ |
Modified pkgIndex.tcl.in
from [97e308791e]
to [a7daa6d089].
1 | 1 2 3 4 5 6 7 8 9 | - - - + + + + - - + |
|
Modified tests/remote.tcl
from [822d07082f]
to [26f53255a5].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | # This file contains Tcl code to implement a remote server that can be # used during testing of Tcl socket code. This server is used by some # of the tests in socket.test. # # Source this file in the remote server you are using to test Tcl against. # # Copyright (c) 1995-1996 Sun Microsystems, Inc. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # |
︙ | |||
167 168 169 170 171 172 173 174 | 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | + + + + - + - - + - - - - - - - - - - - - | puts "from the shell. The tests will not work properly if you set" puts "remoteServerIP to \"localhost\" or 127.0.0.1." puts "" puts -nonewline "Type Ctrl-C to terminate--> " flush stdout } set certsDir [file join [file dirname [info script]] certs] set serverCert [file join $certsDir server.pem] set caCert [file join $certsDir cacert.pem] set serverKey [file join $certsDir skey.pem] if {[catch {set serverSocket \ |
Modified tests/tlsIO.test
from [321099ebe7]
to [e303767c20].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | # Commands tested in this file: socket. # # This file contains a collection of tests for one or more of the Tcl # built-in commands. Sourcing this file into Tcl runs the tests and # generates output for errors. No output means no errors were found. # # Copyright (c) 1994-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # |
︙ | |||
48 49 50 51 52 53 54 | 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | - + + + - + + - - - - - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + | # # % set remoteServerIP <name or address of machine on which server runs> # % set remoteServerPort 8048 # # These variables are also settable from the environment. On Unix, you can: # # shell% setenv remoteServerIP machine.where.server.runs |
︙ | |||
127 128 129 130 131 132 133 | 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + - - - + + - - + - - - - + + - - + | set remoteProcChan "" set commandSocket "" if {$doTestsWithRemoteServer} { catch {close $commandSocket} if {[catch {set commandSocket [tls::socket \ -certfile $clientCert -cafile $caCert -keyfile $clientKey \ |
︙ | |||
209 210 211 212 213 214 215 216 217 218 219 220 221 222 | 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 | + + + + + + + + + + + + + + + | return [lindex $resp 1] } } else { append resp $line "\n" } } } sendCommand [list proc dputs [info args dputs] [info body dputs]] proc sendCertValues {} { # We need to be able to send certificate values that normalize # filenames across platforms sendCommand { set certsDir [file join [file dirname [info script]] certs] set serverCert [file join $certsDir server.pem] set clientCert [file join $certsDir client.pem] set caCert [file join $certsDir cacert.pem] set serverKey [file join $certsDir skey.pem] set clientKey [file join $certsDir ckey.pem] } } } test tlsIO-1.1 {arg parsing for socket command} {socket} { list [catch {tls::socket -server} msg] $msg } {1 {wrong # args: should be "tls::socket -server command ?options? port"}} test tlsIO-1.2 {arg parsing for socket command} {socket} { |
︙ | |||
309 310 311 312 313 314 315 | 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 | - + - - + + | set f [open script w] puts $f { package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8829 \]" puts $f { |
︙ | |||
348 349 350 351 352 353 354 | 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 | - + - - + + | set f [open script w] puts $f { package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8830 \]" puts $f { |
︙ | |||
385 386 387 388 389 390 391 | 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 | - + - - + + | set f [open script w] puts $f { package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey -myaddr [info hostname] 8831 \]" puts $f { |
︙ | |||
421 422 423 424 425 426 427 | 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 | - + - - + + | set f [open script w] puts $f { package require tls set timer [after 2000 "set x done"] } puts $f "set f \[tls::socket -server accept -certfile $serverCert -cafile $caCert -keyfile $serverKey 8832 \]" puts $f { |
︙ | |||
560 561 562 563 564 565 566 | 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 | - + - + - - - - - - - - - - + | removeFile script set f [open script w] puts -nonewline $f {package require tls; tls::socket -server accept 8828} close $f set f [open "|[list $::tcltest::tcltest script]" r] gets $f after 100 |
︙ | |||
600 601 602 603 604 605 606 | 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 | - + + + + + - - + - - - - - + + + + + + + + - - + + - + - + - + + + + | close $cs vwait done after cancel $timer set done } 1 |
︙ | |||
759 760 761 762 763 764 765 766 767 768 769 770 771 772 | 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 | + | close $s3 lappend x [gets $f] close $f set x } {ready done} test tlsIO-4.1 {server with several clients} {socket stdio} { # have seen intermittent hangs on Windows removeFile script set f [open script w] puts $f { package require tls gets stdin } puts $f "set s \[tls::socket -certfile $clientCert -cafile $caCert -keyfile $clientKey 127.0.0.1 8828 \]" |
︙ | |||
802 803 804 805 806 807 808 | 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 | - + | } } set t1 [after 30000 "set x timed_out"] set t2 [after 31000 "set x timed_out"] set t3 [after 32000 "set x timed_out"] set s [tls::socket \ -certfile $serverCert -cafile $caCert -keyfile $serverKey \ |
︙ | |||
863 864 865 866 867 868 869 | 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 | - + + + - + - + + - - - + + - + | if {![catch {tls::socket -server dodo 21} msg]} { set x {htons problem, should be disallowed, are you running as SU?} close $msg } set x } {couldn't open socket: not owner} |
︙ | |||
923 924 925 926 927 928 929 | 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 | - - - + | close $f set l "" lappend l [string compare [lindex $p 0] 127.0.0.1] lappend l [string compare [lindex $p 2] 8820] lappend l [llength $p] } {0 0 3} |
︙ | |||
969 970 971 972 973 974 975 | 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | - + | close $s update llength $l } 12 # bug report #5812 fconfigure doesn't return value for '-sockname' |
︙ | |||
992 993 994 995 996 997 998 | 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | - + - - + + - - + + - - - - + + + + - - - - - - - - - - - - - - + + + + + + - - + + + + + + + + + + - + - - - + + + - - + + - - + + + + + - + - - + - - - - - - - + - - + + + + + + + + + + + - - - + + + - + - - + + + + - + + - - - + + + - - + + | close $s1 set l "" lappend l [lindex $x 2] [llength $x] } {8823 3} # bug report #5812 fconfigure doesn't return value for '-sockname' |
︙ | |||
1167 1168 1169 1170 1171 1172 1173 | 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 | - - + + + - - + + - - - + + + - + - + - - - + - - - + - - - - - + - - - - + - - - - - + - + - - - + - + - - - - - - - - + - - | set count 0 set done false proc write_then_close {s} { puts $s bye close $s } proc accept {s a p} { |
︙ | |||
1319 1320 1321 1322 1323 1324 1325 | 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 | - + - - - - - + - - - | set r [gets $f] close $f sendCommand {close $socket10_6_test_server} set r } hello test tlsIO-11.5 {remote echo, 50 lines} {socket doTestsWithRemoteServer} { |
︙ | |||
1383 1384 1385 1386 1387 1388 1389 1390 1391 | 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 | + - + - - - - | close $s2 } close $s1 set result } $conflictResult test tlsIO-11.7 {server with several clients} {socket doTestsWithRemoteServer} { sendCertValues sendCommand { set socket10_9_test_server [tls::socket \ |
︙ | |||
1431 1432 1433 1434 1435 1436 1437 | 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 | - - + + - - + - - - - + + - - - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - - - + - - - + - + - - - - - + - - - + - - + + - - - - - + - - - - - + + + - - - - - - - - - + + + + + + + + + + + + + - - + | close $s1 close $s2 close $s3 sendCommand {close $socket10_9_test_server} set i } 100 |
︙ | |||
1583 1584 1585 1586 1587 1588 1589 | 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 | + + + + - + - + - + + + - + - - - - - + - - - + - + - - - - - + - - - - + - - - - + - - - + - - + + - + - - - + + - - + - - - + - - + + - - + - - - - + - - - + + - + - - + - - + + - - + + - + - - + + - | } else { incr len [string length $l] } } set c [tls::socket \ -certfile $clientCert -cafile $caCert -keyfile $clientKey \ $remoteServerIP 8836] # Get the buffering corrected fconfigure $c -buffering line # Put a byte into the client pipe to trigger TLS handshaking puts $c a |
︙ | |||
1846 1847 1848 1849 1850 1851 1852 | 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 | - + - - - + - - - + + - + - - + - - + + + - + - + - + + + + - - + - - - - + | # script1 process must have inherited the client. set failed 0 after 5000 [list set failed 1] # Launch the script2 process |
︙ | |||
2004 2005 2006 2007 2008 2009 2010 | 1976 1977 1978 1979 1980 1981 1982 | - | flush $commandSocket } catch {close $commandSocket} catch {close $remoteProcChan} ::tcltest::cleanupTests flush stdout return |
Modified tls.c
from [1fe77384fc]
to [d793bbc229].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | /* * Copyright (C) 1997-1999 Matt Newman <matt@novadigm.com> * |
︙ | |||
27 28 29 30 31 32 33 | 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | + - + - - + + - - + + - - + + - - + + - + + | */ /* * Forward declarations */ #define F2N( key, dsp) \ (((key) == NULL) ? (char *) NULL : \ |
︙ | |||
215 216 217 218 219 220 221 | 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 | + + - - - + + + - - - + + - - + - + - + + - + - + + | * The err field of the currently operative State is set * to a string describing the SSL negotiation failure reason *------------------------------------------------------------------- */ static int VerifyCallback(int ok, X509_STORE_CTX *ctx) { Tcl_Obj *cmdPtr; char *errStr; |
︙ | |||
301 302 303 304 305 306 307 | 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 | - + - - + + - - + + - - + + - - + + - + - + - + - - + + | */ void Tls_Error(State *statePtr, char *msg) { Tcl_Obj *cmdPtr; if (msg && *msg) { |
︙ | |||
453 454 455 456 457 458 459 | 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 | - + - - + - | Tcl_AppendResult(interp, "protocol not supported", NULL); return TCL_ERROR; #else ctx = SSL_CTX_new(TLSv1_method()); break; #endif } if (ctx == NULL) { |
︙ | |||
536 537 538 539 540 541 542 543 544 545 546 547 | 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 | + + + + + + - + - + - - + + + + + | return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetStringFromObj(objv[1], NULL), NULL); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } #ifdef TCL_CHANNEL_VERSION_2 /* * Make sure to operate on the topmost channel */ chan = Tcl_GetTopChannel(chan); #endif if (Tcl_GetChannelType(chan) != Tls_ChannelType()) { Tcl_AppendResult(interp, "bad channel \"", Tcl_GetChannelName(chan), "\": not a TLS channel", NULL); return TCL_ERROR; } |
︙ | |||
588 589 590 591 592 593 594 | 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 | - - - + + - - - - - - - - + + + + + + + + | ImportObjCmd(clientData, interp, objc, objv) ClientData clientData; /* Not used. */ Tcl_Interp *interp; int objc; Tcl_Obj *CONST objv[]; { Tcl_Channel chan; /* The channel to set a mode on. */ |
︙ | |||
628 629 630 631 632 633 634 635 636 637 638 639 640 641 | 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 | + + + + + + | return TCL_ERROR; } chan = Tcl_GetChannel(interp, Tcl_GetStringFromObj(objv[1], NULL), NULL); if (chan == (Tcl_Channel) NULL) { return TCL_ERROR; } #ifdef TCL_CHANNEL_VERSION_2 /* * Make sure to operate on the topmost channel */ chan = Tcl_GetTopChannel(chan); #endif for (idx = 2; idx < objc; idx++) { char *opt = Tcl_GetStringFromObj(objv[idx], NULL); if (opt[0] != '-') break; |
︙ | |||
654 655 656 657 658 659 660 | 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 | - + - + - - - - - + + + + + - - + + + + + + + + - - + + - + - + - - - + + + - - - + + + - - + + - - - - - + + + + + - + + + + + + + + + - - - + + + + + + + - + + - + - + - - - + + - + - - + + - + | OPTBOOL( "-ssl3", ssl3); OPTBOOL( "-tls1", tls1); OPTBAD( "option", "-cafile, -cadir, -certfile, -cipher, -command, -keyfile, -model, -require, -request, -ssl2, -ssl3, -server, or -tls1"); return TCL_ERROR; } |
︙ | |||
937 938 939 940 941 942 943 | 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 | - + | if (!SSL_CTX_load_verify_locations(ctx, F2N(CAfile, &ds), F2N(CAdir, &ds1)) || !SSL_CTX_set_default_verify_paths(ctx)) { #if 0 Tcl_DStringFree(&ds); Tcl_DStringFree(&ds1); /* Don't currently care if this fails */ Tcl_AppendResult(interp, "SSL default verify paths: ", |
︙ | |||
982 983 984 985 986 987 988 | 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 | - - + + + + + + + + - - - - - - + + + + + + + - - - - + + + + | if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "channel"); return TCL_ERROR; } channelName = Tcl_GetStringFromObj(objv[1], NULL); |
︙ | |||
1055 1056 1057 1058 1059 1060 1061 | 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 | + - + + + + + + + + - - - - - | * Frees all the state * *------------------------------------------------------------------- */ void Tls_Clean(State *statePtr) { /* |
︙ | |||
1097 1098 1099 1100 1101 1102 1103 1104 1105 | 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 | + + + + - - - + + - - + + - - + + - - + + - | * to be made available. */ { #if TCL_MAJOR_VERSION >= 8 && TCL_MINOR_VERSION >= 2 if (!Tcl_InitStubs(interp, TCL_VERSION, 0)) { return TCL_ERROR; } #endif if (SSL_library_init() != 1) { Tcl_AppendResult(interp, "could not initialize SSL library", NULL); return TCL_ERROR; } SSL_load_error_strings(); ERR_load_crypto_strings(); |
︙ |
Modified tls.tcl
from [0307107ef1]
to [ee125cf739].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | # # Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com> # |
︙ | |||
44 45 46 47 48 49 50 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + | set argc [llength $args] set sopts {} set iopts [concat [list -server $server] ${tls::defaults}] ;# Import options for {set idx 0} {$idx < $argc} {incr idx} { set arg [lindex $args $idx] switch -glob -- $server,$arg { |
︙ | |||
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 | + + + + + + + + + + + + + + + + + - - + + - - - - - + + + + + - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - + + + + + + - + | } err]} { set info ${::errorInfo} catch {close $chan} return -code error -errorinfo $info $err } return $chan } # tls::_accept -- # # This is the actual accept that TLS sockets use, which then calls # the callback registered by tls::socket. # # Arguments: # iopts tls::import opts # callback server callback to invoke # chan socket channel to accept/deny # ipaddr calling IP address # port calling port # # Results: # Returns an error if the callback throws one. # proc tls::_accept { iopts callback chan ipaddr port } { log 2 [list tls::_accept $iopts $callback $chan $ipaddr $port] set chan [eval [list tls::import $chan] $iopts] lappend callback $chan $ipaddr $port if {[catch { uplevel #0 $callback } err]} { log 1 "tls::_accept error: ${::errorInfo}" close $chan error $err $::errorInfo $::errorCode } else { log 2 "tls::_accept - called \"$callback\" succeeded" } } # # Sample callback for hooking: - # # error # info # password # verify # proc tls::callback {option args} { variable debug #log 2 [concat $option $args] switch -- $option { |
︙ |
Modified tlsBIO.c
from [e6c3698fee]
to [8a7d792ec5].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | /* * Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com> * |
︙ | |||
34 35 36 37 38 39 40 | 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | - - - - + + + + - + + + + - + + - + - + - + + + + + - + + - + - + - + + - + | BIO * BIO_new_tcl(statePtr, flags) State *statePtr; int flags; { BIO *bio; |
︙ | |||
142 143 144 145 146 147 148 | 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | - - - + + + - - - + + + + + - + - + - + - + - + - - - - + + + + + - - - - + + + + + + + - + - - - - + + + + - + + - - - + + + | break; case BIO_CTRL_INFO: ret = 1; break; case BIO_C_SET_FD: BioFree(bio); /* Sets State* */ |
Modified tlsIO.c
from [83d2c33ca1]
to [1cbb80c69b].
1 2 3 | 1 2 3 4 5 6 7 8 9 10 11 | - + | /* * Copyright (C) 1997-2000 Matt Newman <matt@novadigm.com> * |
︙ | |||
28 29 30 31 32 33 34 | 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 | - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + - - - - + + + + + + + + + + + - - - + + + + - + - + + + + + - + - + - + + - - + + - - - - + - - + - + - - - - - + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - - + + + + - + - - + + - + + + + + + + + + + + + + - + + - + - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + - - - + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + | * Local Defines */ /* * Forward declarations */ |
︙ | |||
499 500 501 502 503 504 505 | 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 | - + - + + - + - + - + | Tcl_NotifyChannel(statePtr->self, mask); if (statePtr->timer != (Tcl_TimerToken)NULL) { Tcl_DeleteTimerHandler(statePtr->timer); statePtr->timer = (Tcl_TimerToken)NULL; } |
︙ | |||
576 577 578 579 580 581 582 | 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 | - + + + - + + - + + + + - - + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + + | /* Not initialized yet! */ if (statePtr->flags & TLS_TCL_SERVER) { err = SSL_accept(statePtr->ssl); } else { err = SSL_connect(statePtr->ssl); } /*SSL_write(statePtr->ssl, (char*)&err, 0); HACK!!! */ |