Overview
Comment: | Support using OS resolvers |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
d5ffbea19aad9712674d4a6fe99bf14e |
User & Date: | rkeene on 2019-01-17 01:55:06 |
Other Links: | manifest | tags |
Context
2019-01-17
| ||
01:57 | More stats work check-in: 008bdd4f8f user: rkeene tags: trunk | |
01:55 | Support using OS resolvers check-in: d5ffbea19a user: rkeene tags: trunk | |
2019-01-16
| ||
21:38 | Moved some of the argon2 patches to a patch file check-in: 4cee3b7e59 user: rkeene tags: trunk | |
Changes
Modified configure.ac from [599d9d3209] to [043dc52128].
︙ | |||
105 106 107 108 109 110 111 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | - - - + + + + + + + + + + | if test -n "${tcl_nano_openmp}"; then CFLAGS="$CFLAGS ${tcl_nano_openmp}" AC_DEFINE([NANO_TCL_HAVE_OPENMP], [1], [Define if you have support for OpenMP]) fi dnl Random number generation mechanisms |
︙ | |||
154 155 156 157 158 159 160 | 161 162 163 164 165 166 167 168 169 170 | - | ]) if test "$tcl_nano_amalgamation" = 'true'; then TCL_NANO_AMALGAMATION='1' else TCL_NANO_AMALGAMATION='0' fi AC_SUBST(TCL_NANO_AMALGAMATION) |
Modified nano.c from [d9395b5407] to [f5fc2eab10].
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 | + + + + + + + + + + + + + + + + + + + + + | /* XXX:TODO: OpenMP support is currently incomplete */ #undef NANO_TCL_HAVE_OPENMP #include <stdint.h> #include <limits.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <tcl.h> #ifdef NANO_TCL_HAVE_OPENMP # include <omp.h> #endif /* * We need both getaddrinfo and inet_ntop for DNS resolution */ #if defined(HAVE_GETNAMEINFO) && defined(HAVE_GETADDRINFO) # define NANO_TCL_CAN_RESOLVE_NAMES 1 #else # undef NANO_TCL_CAN_RESOLVE_NAMES #endif #ifdef NANO_TCL_CAN_RESOLVE_NAMES # ifdef HAVE_SYS_SOCKET_H # include <sys/socket.h> # endif # ifdef HAVE_SYS_TYPES_H # include <sys/types.h> # endif # ifdef HAVE_NETDB_H # include <netdb.h> # endif #endif #include "randombytes.h" #include "monocypher.h" #include "argon2.h" #include "aes.h" #define NANO_SECRET_KEY_LENGTH 32 #define NANO_PUBLIC_KEY_LENGTH 32 |
︙ | |||
563 564 565 566 567 568 569 570 571 572 573 574 575 576 | 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 620 621 622 623 624 625 626 627 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 687 688 689 690 691 692 693 694 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | Tcl_SetObjResult(interp, Tcl_NewByteArrayObj(buffer, number_of_bytes)); return(TCL_OK); /* NOTREACH */ clientData = clientData; } #ifdef NANO_TCL_CAN_RESOLVE_NAMES static int nano_tcl_resolve_name(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_Encoding ascii_encoding; Tcl_Obj *list_of_hostnames, *hostname_obj; struct addrinfo *gai_data, *addr_current; char *hostname_utf8, hostname[256]; int hostname_utf8_length, hostname_utf8_length_processed, hostname_length; int tute_ret, gai_ret, gni_ret; if (objc != 2) { Tcl_WrongNumArgs(interp, 1, objv, "hostname"); return(TCL_ERROR); } hostname_utf8 = Tcl_GetStringFromObj(objv[1], &hostname_utf8_length); if (!hostname_utf8) { return(TCL_ERROR); } /* * getaddrinfo() accepts ASCII input, so convert to that encoding */ ascii_encoding = Tcl_GetEncoding(interp, "ascii"); if (ascii_encoding == NULL) { return(TCL_ERROR); } tute_ret = Tcl_UtfToExternal(interp, ascii_encoding, hostname_utf8, hostname_utf8_length, TCL_ENCODING_STOPONERROR, NULL, hostname, sizeof(hostname), &hostname_utf8_length_processed, &hostname_length, NULL ); Tcl_FreeEncoding(ascii_encoding); if (tute_ret != TCL_OK) { Tcl_SetResult(interp, "Failed to convert to ASCII", NULL); return(TCL_ERROR); } if (hostname_utf8_length_processed != hostname_utf8_length) { Tcl_SetResult(interp, "Failed to convert entire buffer", NULL); return(TCL_ERROR); } gai_ret = getaddrinfo(hostname, NULL, NULL, &gai_data); if (gai_ret == EAI_NODATA || gai_ret == EAI_NONAME) { Tcl_SetResult(interp, "", NULL); return(TCL_OK); } if (gai_ret != 0) { Tcl_SetResult(interp, (char *) gai_strerror(gai_ret), NULL); return(TCL_ERROR); } list_of_hostnames = Tcl_NewObj(); for (addr_current = gai_data; addr_current; addr_current = addr_current->ai_next) { if (addr_current->ai_family != AF_INET && addr_current->ai_family != AF_INET6) { continue; } gni_ret = getnameinfo(addr_current->ai_addr, addr_current->ai_addrlen, hostname, sizeof(hostname), NULL, 0, NI_NUMERICHOST ); if (gni_ret != 0) { continue; } hostname_obj = Tcl_NewStringObj(hostname, -1); Tcl_ListObjAppendElement(NULL, list_of_hostnames, hostname_obj); } freeaddrinfo(gai_data); Tcl_SetObjResult(interp, list_of_hostnames); return(TCL_OK); /* NOTREACH */ clientData = clientData; } #else static int nano_tcl_resolve_name(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { Tcl_SetResult(interp, "Not supported on this platform", NULL); return(TCL_ERROR); } #endif static int nano_tcl_self_test(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) { if (objc != 1) { Tcl_WrongNumArgs(interp, 1, objv, ""); return(TCL_ERROR); } |
︙ | |||
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 625 626 627 628 629 630 631 632 633 634 635 636 | 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 | + + + + + + + | #endif if (!interp) { return(TCL_OK); } TclNano_CreateNamespace(interp, "::nano"); TclNano_CreateNamespace(interp, "::nano::internal"); TclNano_CreateNamespace(interp, "::nano::block"); TclNano_CreateNamespace(interp, "::nano::key"); TclNano_CreateNamespace(interp, "::nano::work"); TclNano_SetIntVar(interp, "::nano::block::hashLength", NANO_BLOCK_HASH_LENGTH); TclNano_SetIntVar(interp, "::nano::block::signatureLength", NANO_BLOCK_SIGNATURE_LENGTH); TclNano_SetIntVar(interp, "::nano::key::publicKeyLength", NANO_PUBLIC_KEY_LENGTH); TclNano_SetIntVar(interp, "::nano::key::privateKeyLength", NANO_SECRET_KEY_LENGTH); TclNano_SetIntVar(interp, "::nano::key::seedLength", NANO_SECRET_KEY_LENGTH); TclNano_SetIntVar(interp, "::nano::work::workValueLength", NANO_WORK_VALUE_LENGTH); TclNano_SetIntVar(interp, "::nano::work::workHashLength", NANO_WORK_HASH_LENGTH); #ifdef NANO_TCL_CAN_RESOLVE_NAMES TclNano_SetIntVar(interp, "::nano::internal::haveResolveName", 1); #else TclNano_SetIntVar(interp, "::nano::internal::haveResolveName", 0); #endif TclNano_CreateObjCommand(interp, "::nano::internal::selfTest", nano_tcl_self_test); TclNano_CreateObjCommand(interp, "::nano::internal::generateKey", nano_tcl_generate_keypair); TclNano_CreateObjCommand(interp, "::nano::internal::generateSeed", nano_tcl_generate_seed); TclNano_CreateObjCommand(interp, "::nano::internal::publicKey", nano_tcl_secret_key_to_public_key); TclNano_CreateObjCommand(interp, "::nano::internal::signDetached", nano_tcl_sign_detached); TclNano_CreateObjCommand(interp, "::nano::internal::verifyDetached", nano_tcl_verify_detached); TclNano_CreateObjCommand(interp, "::nano::internal::hashData", nano_tcl_hash_data); TclNano_CreateObjCommand(interp, "::nano::internal::deriveKeyFromPassword", nano_tcl_derive_key_from_password); TclNano_CreateObjCommand(interp, "::nano::internal::AES256-CTR", nano_tcl_aes256_ctr); TclNano_CreateObjCommand(interp, "::nano::internal::validateWork", nano_tcl_validate_work); TclNano_CreateObjCommand(interp, "::nano::internal::generateWork", nano_tcl_generate_work); TclNano_CreateObjCommand(interp, "::nano::internal::randomBytes", nano_tcl_random_bytes); TclNano_CreateObjCommand(interp, "::nano::internal::resolveName", nano_tcl_resolve_name); TclNano_Eval(interp, nanoInitScript); TclNano_PkgProvide(interp, "nano", PACKAGE_VERSION); return(TCL_OK); } |
Modified nano.tcl from [184c8f262e] to [2645fe4623].
︙ | |||
26 27 28 29 30 31 32 | 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | - + | namespace eval ::nano::node::cli {} namespace eval ::nano::node::stats {} namespace eval ::nano::network::client {} namespace eval ::nano::network::server {} namespace eval ::nano::protocol::create {} namespace eval ::nano::protocol::parse {} namespace eval ::nano::protocol::extensions {} |
︙ | |||
1976 1977 1978 1979 1980 1981 1982 | 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 | - | foreach proc $procs { proc ::nano::node::ledger::$proc args [concat [list tailcall {*}$handle $proc] {{*}$args}] } } proc ::nano::node::configure {network args} { package require ip |
︙ | |||
3003 3004 3005 3006 3007 3008 3009 | 3002 3003 3004 3005 3006 3007 3008 3009 3010 3011 3012 3013 3014 3015 3016 3017 3018 3019 3020 3021 3022 3023 3024 3025 3026 3027 | - + + + + + + + + + | lappend ::nano::node::bootstrap::frontiers_to_pull [dict create account $account frontier $frontier] } } return } |
︙ | |||
3240 3241 3242 3243 3244 3245 3246 | 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 | - + | } set completePeers [list] foreach peer $peers { lassign [::nano::internal::parseAddress $peer $defaultPeerPort] peer peerPort catch { |
︙ |