Overview
Comment: | Added set option support. Source: https://www.androwish.org/home/info/1af65d23b6962476 |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | nijtmans |
Files: | files | file ages | folders |
SHA3-256: |
baec6798d64cb7725a4907bc1b7a0fd1 |
User & Date: | jan.nijtmans on 2024-02-23 11:57:15 |
Other Links: | branch diff | manifest | tags |
Context
2024-02-23
| ||
13:08 | Add "tls::build-info" command check-in: 355a10cf0e user: jan.nijtmans tags: nijtmans | |
12:13 | Merge trunk check-in: fc4f8bad30 user: jan.nijtmans tags: bohagan | |
11:57 | Added set option support. Source: https://www.androwish.org/home/info/1af65d23b6962476 check-in: baec6798d6 user: jan.nijtmans tags: nijtmans | |
11:00 | Move tls.htm -> doc/tls.html. Start conversion to HTML5 check-in: f4edd2b33b user: jan.nijtmans tags: nijtmans | |
Changes
Modified generic/tlsIO.c from [f0f140b4c0] to [e1102d2f2c].
︙ | |||
37 38 39 40 41 42 43 | 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | - + | * * Side effects: * Sets the device into blocking or nonblocking mode. * *------------------------------------------------------------------- */ static int TlsBlockModeProc(void *instanceData, int mode) { |
︙ | |||
229 230 231 232 233 234 235 | 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 | - - - - - + | *errorCodePtr = backingError; if (*errorCodePtr == ECONNRESET) { *errorCodePtr = ECONNABORTED; } } statePtr->flags |= TLS_TCL_HANDSHAKE_FAILED; |
︙ | |||
296 297 298 299 300 301 302 | 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | - + | static int TlsInputProc( void *instanceData, char *buf, int bufSize, int *errorCodePtr) { unsigned long backingError; |
︙ | |||
428 429 430 431 432 433 434 | 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 | - + | static int TlsOutputProc( void *instanceData, const char *buf, int toWrite, int *errorCodePtr) { unsigned long backingError; |
︙ | |||
548 549 550 551 552 553 554 555 556 557 558 559 560 561 | 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 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | dprintf("Output(%d) -> %d", toWrite, written); return(written); } /* *------------------------------------------------------------------- * * TlsSetOptionProc -- * * Sets an option value for a SSL socket based channel, or a * list of all options and their values. * * Results: * TCL_OK if successful or TCL_ERROR if failed. * * Side effects: * Updates channel option to new value. * *------------------------------------------------------------------- */ static int TlsSetOptionProc(void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For errors - can be NULL. */ const char *optionName, /* Name of the option to set the value for, or * NULL to get all options and their values. */ const char *optionValue) /* Value for option. */ { State *statePtr = (State *)instanceData; Tcl_Channel downChan = Tls_GetParent(statePtr, TLS_TCL_FASTPATH); Tcl_DriverSetOptionProc *setOptionProc; setOptionProc = Tcl_ChannelSetOptionProc(Tcl_GetChannelType(downChan)); if (setOptionProc != NULL) { return (*setOptionProc)(Tcl_GetChannelInstanceData(downChan), interp, optionName, optionValue); } else if (optionName == (char*) NULL) { /* * Request is query for all options, this is ok. */ return TCL_OK; } /* * Request for a specific option has to fail, we don't have any. */ return Tcl_BadChannelOption(interp, optionName, ""); } /* *------------------------------------------------------------------- * * TlsGetOptionProc -- * * Gets an option value for a SSL socket based channel, or a * list of all options and their values. * * Results: * A standard Tcl result. The value of the specified option or a |
︙ | |||
571 572 573 574 575 576 577 | 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 | - + - + | TlsGetOptionProc( void *instanceData, /* Socket state. */ Tcl_Interp *interp, /* For errors - can be NULL. */ const char *optionName, /* Name of the option to retrieve the value for, or * NULL to get all options and their values. */ Tcl_DString *optionValue) /* Where to store the computed value initialized by caller. */ { |
︙ | |||
615 616 617 618 619 620 621 | 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 697 698 699 700 701 702 | - + - + - - + | static void TlsWatchProc( void *instanceData, /* The socket state. */ int mask) /* Events of interest; an OR-ed combination of * TCL_READABLE, TCL_WRITABLE and TCL_EXCEPTION. */ { Tcl_Channel downChan; |
︙ | |||
840 841 842 843 844 845 846 | 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 | - + | static const Tcl_ChannelType tlsChannelType = { "tls", /* Type name */ TCL_CHANNEL_VERSION_5, /* v5 channel */ TlsCloseProc, /* Close proc */ TlsInputProc, /* Input proc */ TlsOutputProc, /* Output proc */ 0, /* Seek proc */ |
︙ |