message
stringlengths
6
474
diff
stringlengths
8
5.22k
Travis: Also check formatting with Clang-Format 6
@@ -63,6 +63,9 @@ matrix: - os: linux compiler: gcc + apt: + sources: [ llvm-toolchain-trusty-6.0, ubuntu-toolchain-r-test] + packages: [ clang-format-6.0 ] - os: linux compiler: clang
CI: Appveyor: disable examples
@@ -14,5 +14,5 @@ before_build: build_script: - cd build - - cmake -G "%msvc%" -DCMAKE_BUILD_TYPE=%configuration% -DFLB_WITHOUT_SHARED_LIB=On .. + - cmake -G "%msvc%" -DCMAKE_BUILD_TYPE=%configuration% -DFLB_WITHOUT_SHARED_LIB=On -DFLB_WITHOUT_EXAMPLES=On .. - cmake --build .
Add back set_signal_sock_function Has wrongly removed when migrating to LwIP 2.0
@@ -207,6 +207,24 @@ void sys_arch_unprotect(sys_prot_t pval) { osalSysRestoreStatusX((syssts_t)pval); } +//////////////////////////////////////////////////// +// nanoFramework "hack" extending LwIP original code +// with this callback here we don't need any reference to CLR nor need to include any nanoFramework headers here +void (*signal_sock_functionPtr)() = 0; + +void set_signal_sock_function( void (*funcPtr)() ) +{ + signal_sock_functionPtr = funcPtr; +} + +void sys_signal_sock_event() +{ + if ( signal_sock_functionPtr != 0 ) + signal_sock_functionPtr(); +} + +//////////////////////////////////////////////////// + u32_t sys_now(void) { #if OSAL_ST_FREQUENCY == 1000
hslua-packaging: Fix imports in Function.hs
@@ -53,7 +53,7 @@ module HsLua.Packaging.Function ) where import Control.Applicative ((<|>)) -import Control.Monad.Except +import Control.Monad ((<$!>), forM_) import Data.Text (Text) import Data.Version (Version) import HsLua.Core
tests: try to fix Valgrind suppressions for testmod_crypto
{ <insert_a_suppression_name_here> Memcheck:Leak - match-leak-kinds: all ... - obj:*/bin/kill* + obj:*kill* ... } { <insert_a_suppression_name_here> Memcheck:Leak - match-leak-kinds: all ... obj:*/usr/bin/pgrep* ...
Reallocate TLS Buffer (OpenSSL)
@@ -270,7 +270,7 @@ int QuicTlsAddHandshakeDataCallback( _In_ SSL *Ssl, _In_ OSSL_ENCRYPTION_LEVEL Level, - _In_reads_(len) const uint8_t *Data, + _In_reads_(Length) const uint8_t *Data, _In_ size_t Length ) { @@ -287,16 +287,46 @@ QuicTlsAddHandshakeDataCallback( Length, Level); - if (Length + TlsState->BufferLength > (size_t)TlsState->BufferAllocLength) { + if (Length + TlsState->BufferLength > 0xF000) { QuicTraceEvent( TlsError, "[ tls][%p] ERROR, %s.", TlsContext->Connection, - "Buffer overflow for output handshake data"); + "Too much handshake data"); + TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR; + return -1; + } + + if (Length + TlsState->BufferLength > (size_t)TlsState->BufferAllocLength) { + // + // Double the allocated buffer length until there's enough room for the + // new data. + // + uint16_t NewBufferAllocLength = TlsState->BufferAllocLength; + while (Length + TlsState->BufferLength > (size_t)NewBufferAllocLength) { + NewBufferAllocLength <<= 1; + } + + uint8_t* NewBuffer = QUIC_ALLOC_NONPAGED(NewBufferAllocLength); + if (NewBuffer == NULL) { + QuicTraceEvent( + AllocFailure, + "Allocation of '%s' failed. (%llu bytes)", + "New crypto buffer", + NewBufferAllocLength); TlsContext->ResultFlags |= QUIC_TLS_RESULT_ERROR; return -1; } + QuicCopyMemory( + NewBuffer, + TlsState->Buffer, + TlsState->BufferLength); + QUIC_FREE(TlsState->Buffer); + TlsState->Buffer = NewBuffer; + TlsState->BufferAllocLength = NewBufferAllocLength; + } + switch (KeyType) { case QUIC_PACKET_KEY_HANDSHAKE: if (TlsState->BufferOffsetHandshake == 0) {
T383: Add comment about needing to create mapping caps in vnode_inherit invocation handler
@@ -369,6 +369,7 @@ static struct sysret handle_inherit(struct capability *dest, " from %p to %p, new flags = %"PRIx64"\n", start, end, src_entry, dst_entry, flags); + // XXX: this should create mapping caps for copied range! for (uint64_t i = start; i < end; ++i) { //printf("kernel: cpy: %p -> %p\n", src_entry+i, dst_entry+i); //printf("kernel: cpy: [%016lx] -> [%016lx]\n", src_entry[i], dst_entry[i]);
OMP_HOST=1 environment variable allows for host compile/run
@@ -38,8 +38,10 @@ else endif ifeq ($(TARGET),) + ifeq ($(OMP_HOST),) TARGET = -fopenmp-targets=$(AOMP_GPUTARGET) -Xopenmp-target=$(AOMP_GPUTARGET) -march=$(AOMP_GPU) endif +endif # OFFLOAD_DEBUG is used by this test harnass to turn on HOST and/or DEVICE level debug ifeq ($(OFFLOAD_DEBUG),1) @@ -69,7 +71,11 @@ ifeq ($(OFFLOAD_DEBUG),5) endif ifeq ($(OMP_FLAGS),) + ifeq ($(OMP_HOST),) OMP_FLAGS = -target $(AOMP_CPUTARGET) -fopenmp $(TARGET) + else + OMP_FLAGS = -target $(AOMP_CPUTARGET) -fopenmp + endif endif OMP_FLAGS += $(EXTRA_OMP_FLAGS)
fixes lv_cont_layout_grid() fails to calculate available space in a row this issue results in space waste in right side of container the size of wasted space in each row is pad_left plus pad_inner
@@ -628,7 +628,7 @@ static void lv_cont_layout_grid(lv_obj_t * cont) _LV_LL_READ_BACK(cont->child_ll, child) { if(lv_obj_get_hidden(child) != false || lv_obj_is_protected(child, LV_PROTECT_POS) != false) continue; lv_coord_t obj_w = lv_obj_get_width(child); - if(act_x + inner + obj_w > w_fit) { + if(act_x + obj_w > w_fit + left) { act_x = left; act_y += y_ofs; }
re-enable curves edit button in vna.py
@@ -110,10 +110,8 @@ class VNA(QMainWindow, Ui_VNA): actions = self.toolbar.actions() if int(matplotlib.__version__[0]) < 2: self.toolbar.removeAction(actions[7]) - self.toolbar.removeAction(actions[9]) else: self.toolbar.removeAction(actions[6]) - self.toolbar.removeAction(actions[7]) self.toolbar.addSeparator() self.cursorLabels = {} self.cursorValues = {}
runtimes/charliecloud: bump to v0.9.1
Summary: Lightweight user-defined software stacks for high-performance computing Name: %{pname}%{PROJ_DELIM} -Version: 0.9.0 +Version: 0.9.1 Release: %{?dist} License: Apache-2.0 Group: %{PROJ_NAME}/runtimes
docs: Fix RtD build Markdown parser has changed[1]. [1]
# Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [] +extensions = ['myst_parser'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -154,7 +154,7 @@ todo_include_todos = False # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied @@ -337,7 +337,3 @@ texinfo_documents = [ # If true, do not generate a @detailmenu in the "Top" node's menu. # # texinfo_no_detailmenu = False - -source_parsers = { - '.md': 'recommonmark.parser.CommonMarkParser', -}
build: enable Spectre mitigation
@@ -15,10 +15,6 @@ Common property definitions used by all drivers: <Message Importance="high" Text="Driver.Initial.props: _NT_TARGET_VERSION=$(_NT_TARGET_VERSION) SUBSYSTEM_NATVER=$(SUBSYSTEM_NATVER) mismatch=$(MidlTargetMismatch)" /> </Target> - <PropertyGroup Label="Globals"> - <SpectreMitigation>false</SpectreMitigation> - </PropertyGroup> - <PropertyGroup Condition="'$(TargetVersion)'=='Windows10'"> <_NT_TARGET_VERSION>0x0A00</_NT_TARGET_VERSION> </PropertyGroup>
Fix WNS instead of TNS, handle TNS=0.000
@@ -171,12 +171,12 @@ report_drc -quiet -ruledeck bitstream_checks -name psl_fpga -file ./R ## ## checking timing ## Extract timing information, change ns to ps, remove leading 0's in number to avoid treatment as octal. -set TIMING_TNS [exec grep -A6 "Design Timing Summary" ./Reports/timing_summary.rpt | tail -n 1 | tr -s " " | cut -d " " -f 2 | tr -d "." | sed {s/^\(\-*\)0*\([0-9]*\)/\1\2/}] -puts [format "%-*s %-*s %-*s %-*s" $widthCol1 "" $widthCol2 "Timing (TNS)" $widthCol3 "$TIMING_TNS ps" $widthCol4 "" ] -if { [expr $TIMING_TNS >= 0 ] } { +set TIMING_WNS [exec grep -A6 "Design Timing Summary" ./Reports/timing_summary.rpt | tail -n 1 | tr -s " " | cut -d " " -f 2 | tr -d "." | sed {s/^\(\-*\)0*\([1-9]*[0-9]\)/\1\2/}] +puts [format "%-*s %-*s %-*s %-*s" $widthCol1 "" $widthCol2 "Timing (WNS)" $widthCol3 "$TIMING_WNS ps" $widthCol4 "" ] +if { [expr $TIMING_WNS >= 0 ] } { puts [format "%-*s %-*s %-*s %-*s" $widthCol1 "" $widthCol2 "" $widthCol3 "TIMING OK" $widthCol4 "" ] set remove_tmp_files TRUE -} elseif { [expr $TIMING_TNS < $timing_lablimit ] && ( $ila_debug != "TRUE" ) } { +} elseif { [expr $TIMING_WNS < $timing_lablimit ] && ( $ila_debug != "TRUE" ) } { puts [format "%-*s %-*s %-*s %-*s" $widthCol1 "" $widthCol2 "" $widthCol3 "ERROR: TIMING FAILED" $widthCol4 "" ] exit 42 } else { @@ -199,7 +199,7 @@ if { $bram_used == "TRUE" } { } else { set RAM_TYPE noSDRAM } -append IMAGE_NAME [format {_%s_%s_%s} $RAM_TYPE $fpgacard $TIMING_TNS] +append IMAGE_NAME [format {_%s_%s_%s} $RAM_TYPE $fpgacard $TIMING_WNS] append IMAGE_NAME [expr {$factory_image == "TRUE" ? "_FACTORY" : ""}]
keystore: clear var
@@ -171,10 +171,12 @@ static bool _get_and_decrypt_seed( encrypted_seed_and_hmac, encrypted_len, decrypted, &decrypted_len, secret); if (*password_correct_out) { if (decrypted_len != KEYSTORE_SEED_LENGTH) { + util_zero(decrypted, sizeof(decrypted)); return false; } memcpy(decrypted_seed_out, decrypted, decrypted_len); } + util_zero(decrypted, sizeof(decrypted)); return true; }
SIGINT on pselect() after ctrl+c is not an ERROR
@@ -6174,7 +6174,7 @@ while(wantstopflag == false) fdnum = pselect(sd +1, &readfds, NULL, NULL, &tsfd, NULL); if(fdnum < 0) { - errorcount++; + if(wantstopflag == false) errorcount++; continue; } if(FD_ISSET(fd_gps, &readfds)) process_gps(); @@ -6525,7 +6525,7 @@ while(wantstopflag == false) fdnum = pselect(sd +1, &readfds, NULL, NULL, &tsfd, NULL); if(fdnum < 0) { - errorcount++; + if(wantstopflag == false) errorcount++; continue; } if(FD_ISSET(fd_gps, &readfds)) process_gps(); @@ -6633,7 +6633,7 @@ while(wantstopflag == false) fdnum = pselect(sd +1, &readfds, NULL, NULL, &tsfd, NULL); if(fdnum < 0) { - errorcount++; + if(wantstopflag == false) errorcount++; continue; } if(FD_ISSET(fd_gps, &readfds)) process_gps();
ames: fix null-deref in capped queue
@@ -400,7 +400,7 @@ _ames_recv_cb(uv_udp_t* wax_u, { u3_ovum* egg_u = sam_u->car_u.ext_u; - while ( 1000 < sam_u->car_u.dep_w ) { + while ( egg_u && (1000 < sam_u->car_u.dep_w) ) { u3_ovum* nex_u = egg_u->nex_u; if ( c3__hear == u3h(egg_u->cad) ) {
driver: rs485 test support (remove timeout tag) Adds test functionality with TEST_CASE_MULTIPLE_DEVICES() macro for RS485 test support.
@@ -324,5 +324,5 @@ static void rs485_master() * correctness of RS485 interface channel communication. It requires * RS485 bus driver hardware to be connected to boards. */ -TEST_CASE_MULTIPLE_DEVICES("RS485 half duplex uart multiple devices test.", "[driver_RS485][test_env=UT_T2_RS485][timeout=200]", rs485_master, rs485_slave); +TEST_CASE_MULTIPLE_DEVICES("RS485 half duplex uart multiple devices test.", "[driver_RS485][test_env=UT_T2_RS485]", rs485_master, rs485_slave);
Allow nng to be consumed in "add_subdirectory" scenarios
@@ -246,7 +246,7 @@ set_target_properties (${PROJECT_NAME} ${PROJECT_NAME} target_link_libraries (${PROJECT_NAME} PRIVATE ${NNG_LIBS}) -target_include_directories (${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>) +target_include_directories (${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>) install (TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}-target
Add missing return To brightness up
@@ -35,7 +35,7 @@ static int on_keymap_binding_pressed(struct device *dev, u32_t position, u32_t a case RGB_SAD: return zmk_rgb_underglow_change_sat(-1); case RGB_BRI: - zmk_rgb_underglow_change_brt(1); + return zmk_rgb_underglow_change_brt(1); case RGB_BRD: return zmk_rgb_underglow_change_brt(-1); case RGB_SPI:
changed to 2019
#define TIC_NAME_FULL TIC_NAME " tiny computer" #define TIC_TITLE TIC_NAME_FULL " " TIC_VERSION_LABEL #define TIC_HOST "tic.computer" -#define TIC_COPYRIGHT "http://" TIC_HOST " (C) 2017" +#define TIC_COPYRIGHT "http://" TIC_HOST " (C) 2019" #define TIC_VRAM_SIZE (16*1024) //16K #define TIC_RAM_SIZE (TIC_VRAM_SIZE+80*1024) //16K+80K
Travis: cache test 06
@@ -13,23 +13,6 @@ install: ##- rvm gemset use rhodes - $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/hosts/$TRAVIS_OS_NAME/install.sh - $TRAVIS_BUILD_DIR/.ci/safe_run.sh $TRAVIS_BUILD_DIR/.ci/targets/$RHO_TARGET/install.sh -##- gem install rest-client -v 1.7.3 --no-document -##- gem install listen -v 3.0.6 --no-document -##- gem install zip --no-document -##- gem install templater -v 1.0.0 --no-document -##- gem install rake -v 12.0.0 --no-document -##- gem install uuid -v 2.3.7 --no-document -##- gem install systemu -v 2.6.4 --no-document -##- gem install json -v 1.8.3 --no-document -##- gem install CFPropertyList -v 2.2.8 --no-document -##- gem install naturally -v 1.3.2 --no-document -##- gem install simctl -v 1.5.6 --no-document -##- gem install listen -v 3.0.6 --no-document -##- gem install rubyzip -v 1.2.1 --no-document -##- gem install ffi -v 1.9.14 --no-document -##- gem install rdoc -v 4.2.2 --no-document -##- gem install deep_merge -v 1.1.1 --no-document -##- gem install nokogiri -v 1.8.2 --no-document script: @@ -38,7 +21,27 @@ script: - gem list - rvm use 2.3.4 +- rvm gemset create rhodes - rvm gemset use rhodes +- gem install rest-client -v 1.7.3 --no-document +- gem install listen -v 3.0.6 --no-document +- gem install zip --no-document +- gem install templater -v 1.0.0 --no-document +- gem install rake -v 12.0.0 --no-document +- gem install uuid -v 2.3.7 --no-document +- gem install systemu -v 2.6.4 --no-document +- gem install json -v 1.8.3 --no-document +- gem install CFPropertyList -v 2.2.8 --no-document +- gem install naturally -v 1.3.2 --no-document +- gem install simctl -v 1.5.6 --no-document +- gem install listen -v 3.0.6 --no-document +- gem install rubyzip -v 1.2.1 --no-document +- gem install ffi -v 1.9.14 --no-document +- gem install rdoc -v 4.2.2 --no-document +- gem install deep_merge -v 1.1.1 --no-document +- gem install nokogiri -v 1.8.2 --no-document + + - rvm list - rvm gemset list
foomatic-rip: Reverted use of pdf_count_pages() and copy_file() of previous commit
@@ -710,29 +710,55 @@ int print_file(const char *filename, int convert) _log("Could not create temporary file: %s\n", strerror(errno)); return EXIT_PRNERR_NORETRY_BAD_SETTINGS; } - tmpfile = fdopen(fd, "r+"); - copy_file(tmpfile, stdin, buf, n); - fclose(tmpfile); - filename = tmpfilename; + /* Copy already read data to the tmp file */ + if (write(fd,buf,n) != n) { + _log("ERROR: Can't copy already read data to temporary file\n"); + close(fd); + } + /* Copy stdin to the tmp file */ + while ((n = read(0,buf,BUFSIZ)) > 0) { + if (write(fd,buf,n) != n) { + _log("ERROR: Can't copy stdin to temporary file\n"); + close(fd); + } + } + /* Rewind tmp file to read it again */ + if (lseek(fd,0,SEEK_SET) < 0) { + _log("ERROR: Can't rewind temporary file\n"); + close(fd); + } - pagecount = pdf_count_pages(filename); + char gscommand[65536]; + char output[31] = ""; + int pagecount; + size_t bytes; + filename = strdup(tmpfilename); + snprintf(gscommand, 65536, "%s -q -dNOPAUSE -dBATCH -sDEVICE=bbox %s 2>&1 | grep -c HiResBoundingBox", + CUPS_GHOSTSCRIPT, filename); + FILE *pd = popen(gscommand, "r"); + bytes = fread(output, 1, 31, pd); + pclose(pd); + + if (bytes <= 0 || sscanf(output, "%d", &pagecount) < 1) + pagecount = -1; if (pagecount < 0) { _log("Unexpected page_count\n"); - unlink(tmpfilename); - return 1; + return 0; } if (pagecount == 0) { _log("No pages left, outputting empty file.\n"); - unlink(tmpfilename); return 1; } _log("File contains %d pages.\n", pagecount); - tmpfile = fopen(tmpfilename, "rb"); + if ((tmpfile = fdopen(fd,"rb")) == 0) { + _log("ERROR: Can't fdopen temporary file\n"); + close(fd); + } ret = print_ps(tmpfile, NULL, 0, filename); fclose(tmpfile); unlink(tmpfilename);
Remove TODO in test/acvp_test.c related to setting AES-GCM iv. Fixes
@@ -837,8 +837,9 @@ static int aes_gcm_enc_dec(const char *alg, goto err; } /* - * TODO(3.0): The IV should not be set outside the boundary as it is now. - * It needs to be fed in via a dummy entropy source for this test. + * For testing purposes the IV it being set here. In a compliant application + * the IV would be generated internally. A fake entropy source could also + * be used to feed in the random IV bytes (see fake_random.c) */ if (!TEST_true(EVP_CipherInit_ex(ctx, NULL, NULL, key, iv, enc)) || !TEST_true(EVP_CIPHER_CTX_set_padding(ctx, 0))
Define common feature test macros for all systems _POSIX_C_SOURCE, _XOPEN_SOURCE and _GNU_SOURCE are also used on Windows. Fix regression introduced by
@@ -42,6 +42,10 @@ src = [ conf = configuration_data() +conf.set('_POSIX_C_SOURCE', '200809L') +conf.set('_XOPEN_SOURCE', '700') +conf.set('_GNU_SOURCE', true) + if host_machine.system() == 'windows' src += [ 'src/sys/win/file.c', @@ -54,9 +58,6 @@ else 'src/sys/unix/file.c', 'src/sys/unix/process.c', ] - conf.set('_POSIX_C_SOURCE', '200809L') - conf.set('_XOPEN_SOURCE', '700') - conf.set('_GNU_SOURCE', true) if host_machine.system() == 'darwin' conf.set('_DARWIN_C_SOURCE', true) endif
ConfigWizard: Allow options to declare a default value Default values can be used in a tool-specific way to implement e.g. "reset to default" buttons.
@@ -64,6 +64,7 @@ The following table lists the Configuration Wizard Annotations: // <o>Round-Robin Timeout [ticks] <1-1000> // \<i> Defines how long a thread will execute before a thread switch. // \<i> Default: 5 + // \<d> 5 #ifndef OS_ROBINTOUT #define OS_ROBINTOUT 5 #endif @@ -110,6 +111,21 @@ The following table lists the Configuration Wizard Annotations: Many examples in this table have tooltip examples. </td> </tr> + <tr> + <td>\<d></td> + <td>yes</td> + <td>Default value for previous item. + \code + // <o MODE> Operation Mode + // <modeOne=> Mode 1 + // <modeTwo=> Mode 2 + // <d> modeOne + // #define MODE modeTwo + \endcode + Binary options, such as \<e> and \<q>, use <code>0</code> and <code>1</code> to signify "disabled" and "enabled", respectively. + Annotating options with a default value enables tools to implement "reset to default" functionality. + </td> + </tr> <tr> <td>\<c><sup>*</sup></td> <td>yes</td> @@ -168,6 +184,7 @@ The following table lists the Configuration Wizard Annotations: // <o>Round-Robin Timeout [ticks] <1-1000> -- text displayed on screen. Range of [ticks] is [1..1000] // \<i> Defines how long a thread will execute before a thread switch. -- tooltip info // \<i> Default: 5 -- tooltip info. Both displayed in one tooltip. + // \<d> 5 -- default value #ifndef OS_ROBINTOUT #define OS_ROBINTOUT 5 #endif @@ -316,6 +333,7 @@ The following table lists the Configuration Wizard Annotations: // <6=> Realtime (highest) // <i> Defines priority for Timer Thread -- tooltip info // <i> Default: High -- tooltip info + // <d> 5 -- default value #ifndef OS_TIMERPRIO #define OS_TIMERPRIO 5 #endif
chat-js: update read on initialisation
@@ -103,6 +103,10 @@ export class ChatScreen extends Component { this.props.api.chat.read(this.props.station); } + if(!prevProps.chatInitialized && props.chatInitialized) { + this.setState({ read: props.read }) + } + if ( (props.length !== prevProps.length || props.envelopes.length !== prevProps.envelopes.length ||
os/board/rtl8721csm: Map TRBLE_ADV_TYPE_DIRECT(value is 1) to 4 for Low Duty Cycle Directed Advertising.
@@ -643,9 +643,8 @@ trble_result_e rtw_ble_server_set_adv_type(trble_adv_type_e type, trble_addr *ad rtw_ble_server_adv_into_idle(); - le_adv_set_param(GAP_PARAM_ADV_EVENT_TYPE, sizeof(adv_evt_type), &adv_evt_type); - if(adv_evt_type == TRBLE_ADV_TYPE_DIRECT) - { + if(adv_evt_type == TRBLE_ADV_TYPE_DIRECT) { + adv_evt_type = 4;/* maps the TRBLE_ADV_TYPE_DIRECT (value is 1) to 4 for Low Duty Cycle Directed advertising */ uint8_t adv_direct_type; if (addr->type == TRBLE_ADDR_TYPE_PUBLIC) { adv_direct_type = GAP_REMOTE_ADDR_LE_PUBLIC; @@ -657,6 +656,7 @@ trble_result_e rtw_ble_server_set_adv_type(trble_adv_type_e type, trble_addr *ad le_adv_set_param(GAP_PARAM_ADV_DIRECT_ADDR_TYPE, sizeof(adv_direct_type), &adv_direct_type); le_adv_set_param(GAP_PARAM_ADV_DIRECT_ADDR, sizeof(adv_direct_addr), adv_direct_addr); } + le_adv_set_param(GAP_PARAM_ADV_EVENT_TYPE, sizeof(adv_evt_type), &adv_evt_type); return TRBLE_SUCCESS; } #endif /* TRBLE_SERVER_C_ */
Adjust comment describing mbedtls_ssl_conf_sni()
@@ -3624,8 +3624,7 @@ void mbedtls_ssl_set_hs_authmode( mbedtls_ssl_context *ssl, * mbedtls_ssl_set_hs_ca_chain() as well as the client * authentication mode with \c mbedtls_ssl_set_hs_authmode(), * then must return 0. If no matching name is found, the - * callback must either set a default cert, or - * return non-zero to abort the handshake at this point. + * callback may return non-zero to abort the handshake. * * \param conf SSL configuration * \param f_sni verification function
Fix test_french_utf8() to work in
@@ -721,7 +721,12 @@ START_TEST(test_french_utf8) const char *text = "<?xml version='1.0' encoding='utf-8'?>\n" "<doc>\xC3\xA9</doc>"; - run_character_check(text, "\xC3\xA9"); +#ifdef XML_UNICODE + const XML_Char *expected = XCS("\x00e9"); +#else + const XML_Char *expected = XCS("\xC3\xA9"); +#endif + run_character_check(text, expected); } END_TEST
rust: Add examples to KeySet documentation
+//! A `KeySet` is a set of `StringKey`s. +//! +//! You can think of it as a specialized version of `Vec`. +//! +//! While you can also store Keys in a `Vec`, you will need to +//! use the `KeySet` to interact with the key database. +//! +//! # Example +//! You can use the [`keyset!`](../macro.keyset.html) macro to create a KeySet. It works just like `vec!`. +//! ``` +//! # use elektra::{KeyBuilder, keyset, KeySet, StringKey, WriteableKey, ReadableKey}; +//! # fn main() -> Result<(), Box<dyn std::error::Error>> { +//! let keyset = keyset![ +//! KeyBuilder::<StringKey>::new("user/sw/app/#1/host")? +//! .value("localhost") +//! .build(), +//! KeyBuilder::<StringKey>::new("user/sw/app/#1/port")? +//! .value("8080") +//! .build(), +//! ]; +//! # Ok(()) +//! # } +//! ``` +//! +//! ## BinaryKeys +//! +//! A KeySet only holds `StringKey`s because they are by far the most +//! common type of key when interacting with the key database. In a typical +//! setup where you read configuration values from the kdb, you will not +//! encounter any BinaryKeys, especially if you set it up yourself. +//! However since the underlying KeySet holds generic `Key`s, `BinaryKey`s +//! can occur. You can cast between the two keys, using `from`. This is safe +//! memory-wise, but can be unsafe if you cast a `BinaryKey` holding arbitrary +//! bytes to a `StringKey`. You can use `is_string` or `is_binary` to find out +//! if the cast is safe. +//! +//! ## Example +//! ``` +//! # use elektra::{BinaryKey, StringKey, WriteableKey, ReadableKey}; +//! # fn main() -> Result<(), Box<dyn std::error::Error>> { +//! # let mut s_key = StringKey::new("user/test/language")?; +//! # s_key.set_value("rust".into()); +//! # let key = BinaryKey::from(s_key); +//! // Assume we have an arbitrary key that is actually a StringKey +//! if key.is_string() { +//! let str_key = StringKey::from(key); +//! assert_eq!(str_key.value(), "rust") +//! } else { +//! panic!("Was not a StringKey!"); +//! } +//! # Ok(()) +//! # } +//! ``` + use crate::{ReadOnly, ReadableKey, StringKey, WriteableKey}; use bitflags::bitflags; use std::convert::TryInto; @@ -157,18 +211,18 @@ impl KeySet { unsafe { Self::from_ptr(ks_ptr) } } - /// Replace the content of a keyset with another one. - /// Copies the contents of source into self + /// Replace the contents of a keyset with those of `source`. + /// Copies the contents of `source` into self. pub fn copy(&mut self, source: &Self) { unsafe { elektra_sys::ksCopy(self.as_ptr(), source.as_ref()) }; } - /// Return the number of keys that ks contains. + /// Return the number of keys that the keyset contains. pub fn size(&self) -> usize { unsafe { elektra_sys::ksGetSize(self.as_ref()).try_into().unwrap() } } - /// Rewinds the KeySet internal cursor. + /// Rewinds the KeySet's internal cursor. pub fn rewind(&mut self) { unsafe { elektra_sys::ksRewind(self.as_ptr());
hw/lpc: Fix theoretical possible out-of-bounds-read number of elements versus starting counting from 0. Found by static analysis.
@@ -519,7 +519,7 @@ static int64_t lpc_probe_test(struct lpcm *lpc) /* Ensure we can perform a valid lookup in the error table */ idx = LPC_ERROR_IDX(irqstat); - if (idx < 0 || idx > ARRAY_SIZE(lpc_error_table)) { + if (idx < 0 || idx >= ARRAY_SIZE(lpc_error_table)) { prerror("LPC bus error translation failed with status 0x%x\n", irqstat); return OPAL_PARAMETER; @@ -1035,7 +1035,7 @@ static void lpc_dispatch_err_irqs(struct lpcm *lpc, uint32_t irqs) /* Ensure we can perform a valid lookup in the error table */ idx = LPC_ERROR_IDX(irqs); - if (idx < 0 || idx > ARRAY_SIZE(lpc_error_table)) { + if (idx < 0 || idx >= ARRAY_SIZE(lpc_error_table)) { prerror("LPC bus error translation failed with status 0x%x\n", irqs); return;
resamp/autotest: increasing number of filters in bank for test
@@ -31,8 +31,8 @@ void testbench_resamp_crcf(float r, float As) // options float bw = 0.25f; // target output signal bandwidth float tol = 0.5f; // output PSD error tolerance [dB] - unsigned int m = 15; // resampler semi-length - unsigned int npfb = 256; // number of filters in bank + unsigned int m = 20; // resampler semi-length + unsigned int npfb = 1024; // number of filters in bank float fc = 0.45f; // resampler cut-off frequency // create resampler @@ -79,7 +79,7 @@ void autotest_resamp_crcf_03() { testbench_resamp_crcf(0.676543210f, 60.0f); } void autotest_resamp_crcf_04() { testbench_resamp_crcf(0.127115323f, 80.0f); } void autotest_resamp_crcf_05() { testbench_resamp_crcf(0.373737373f, 80.0f); } -//void xautotest_resamp_crcf_06() { testbench_resamp_crcf(0.676543210f, 80.0f); } +void autotest_resamp_crcf_06() { testbench_resamp_crcf(0.676543210f, 80.0f); } // test arbitrary resampler output length calculation void testbench_resamp_crcf_num_output(float _rate, unsigned int _npfb)
Fix system version numbers to match string version.
@@ -204,7 +204,7 @@ main(int argc, // I - Number of command-line arguments }; static pappl_version_t versions[1] = // Software versions { - { "Test System", "", "1.2 build 42", { 1, 1, 0, 42 } } + { "Test System", "", "1.2 build 42", { 1, 2, 0, 42 } } };
Add keygen test data
@@ -17447,3 +17447,37 @@ Result = DIGESTUPDATE_ERROR DigestSign = SHA256 Key = ED25519-1 Result = DIGESTSIGNINIT_ERROR + +# Key generation tests +KeyGen = rsaEncryption +Ctrl = rsa_keygen_bits:128 +KeyName = tmprsa +Result = PKEY_CTRL_INVALID +Function = pkey_rsa_ctrl +Reason = key size too small + +# RSA-PSS with restrictions, should succeed. +KeyGen = RSASSA-PSS +KeyName = tmppss +Ctrl = rsa_pss_keygen_md:sha256 +Ctrl = rsa_pss_keygen_mgf1_md:sha512 + +# Check MGF1 restrictions +DigestVerify = SHA256 +Key = tmppss +Ctrl = rsa_mgf1_md:sha256 +Result = PKEY_CTRL_ERROR + +# Test valid digest and MGF1 parameters. Verify will fail +DigestVerify = SHA256 +Key = tmppss +Ctrl = rsa_mgf1_md:sha512 +Input = "" +Output = "" +Result = VERIFY_ERROR + +# Check caching of key MGF1 digest restriction +DigestVerify = SHA256 +Key = tmppss +Ctrl = rsa_mgf1_md:sha1 +Result = PKEY_CTRL_ERROR
rpi-cmdline: Make rootfstype easier to customize
@@ -7,7 +7,9 @@ INHIBIT_DEFAULT_DEPS = "1" inherit deploy nopackages CMDLINE_DWC_OTG ?= "dwc_otg.lpm_enable=0" -CMDLINE_ROOTFS ?= "root=/dev/mmcblk0p2 rootfstype=ext4 rootwait" + +CMDLINE_ROOT_FSTYPE ?= "rootfstype=ext4" +CMDLINE_ROOTFS ?= "root=/dev/mmcblk0p2 ${CMDLINE_ROOT_FSTYPE} rootwait" CMDLINE_SERIAL ?= "${@oe.utils.conditional("ENABLE_UART", "1", "console=serial0,115200", "", d)}"
Tweak RAC spec overview; link to C lib TODO issue
@@ -5,10 +5,19 @@ Status: Draft (as of August 2019). There is no compatibility guarantee yet. ## Overview -The goal of the RAC file format is to compress a source file (the "decompressed -file") such that, starting from the compressed file, it is possible to -reconstruct the half-open byte range `[di .. dj)` of the decompressed file -without always having to first decompress all of `[0 .. di)`. +RAC is a *compressed* file format that allows *random access* (not just +sequential access) to the decompressed contents. In comparison to some other +popular compression formats, all three of the +[Zlib](https://tools.ietf.org/html/rfc1950), +[Brotli](https://tools.ietf.org/html/rfc7932) and +[Zstandard](https://tools.ietf.org/html/rfc8478) specifications explicitly +contain the identical phrase: "the data format defined by this specification +does not attempt to allow random access to compressed data". + +Compression means that the derived file is typically smaller than the original +file. Random access means that, starting from the compressed file, it is +possible to reconstruct the half-open byte range `[di .. dj)` of the +decompressed file without always having to first decompress all of `[0 .. di)`. Conceptually, the decompressed file is partitioned into non-overlapping chunks. Each compressed chunk can be decompressed independently (although possibly @@ -656,6 +665,11 @@ and `0x00`, which means that they are both `CBiasing Branch Node`s. # Reference Implementation +C programming language libraries: + + - TODO. Follow [this GitHub issue](https://github.com/google/wuffs/issues/22) + for updates. + Go programming language libraries: - [RAC](https://godoc.org/github.com/google/wuffs/lib/rac)
out_td: replace msgpack_pack_bin with str
@@ -116,8 +116,8 @@ static char *td_format(void *data, size_t bytes, int *out_size) n_size = map.via.map.size + 1; msgpack_pack_map(&mp_pck, n_size); - msgpack_pack_bin(&mp_pck, 4); - msgpack_pack_bin_body(&mp_pck, "time", 4); + msgpack_pack_str(&mp_pck, 4); + msgpack_pack_str_body(&mp_pck, "time", 4); msgpack_pack_int32(&mp_pck, atime); for (i = 0; i < n_size - 1; i++) {
config: support 'log_level off' to suppress log
@@ -416,6 +416,9 @@ static int set_log_level(struct flb_config *config, const char *v_str) else if (strcasecmp(v_str, "trace") == 0) { config->verbose = 5; } + else if (strcasecmp(v_str, "off") == 0) { + config->verbose = FLB_LOG_OFF; + } else { return -1; }
test-suite: enable extrae tests in long configuration
@@ -263,7 +263,7 @@ AM_CONDITIONAL(GEOPM_ENABLED,test "x$enable_geopm" = "xyes" ) # Extrae AC_ARG_ENABLE([extrae], [AS_HELP_STRING([--enable-extrae],[Enable Extrae tests (default=no)])],[], - [AX_OPTION_DEFAULT(type=long,enable_extrae,no)]) + [AX_OPTION_DEFAULT(type=long,enable_extrae,yes)]) AM_CONDITIONAL(EXTRAE_ENABLED,test "x$enable_extrae" = "xyes" ) #------------------------------------------------------------------------------------------ # HYPRE
Test reusing iodescs across reads Adding tests to make sure that we can reuse iodesc across multiple reads and writes+reads. Also verifying that we get the expected values after the reads.
@@ -99,7 +99,7 @@ PIO_TF_AUTO_TEST_SUB_BEGIN nc_write_1d_reuse_decomp character(len=PIO_TF_MAX_STR_LEN) :: filename1, filename2 type(io_desc_t) :: iodesc integer, dimension(VEC_LOCAL_SZ) :: compdof, compdof_rel_disps - PIO_TF_FC_DATA_TYPE, dimension(VEC_LOCAL_SZ) :: buf + PIO_TF_FC_DATA_TYPE, dimension(VEC_LOCAL_SZ) :: buf, rbuf integer, dimension(1) :: dims integer :: pio_dim_file1, pio_dim_file2 integer :: i, ierr, lsz @@ -166,7 +166,25 @@ PIO_TF_AUTO_TEST_SUB_BEGIN nc_write_1d_reuse_decomp call PIO_write_darray(pio_file2, pio_var1_file2, iodesc, buf, ierr) PIO_TF_CHECK_ERR(ierr, "Failed to write first darray : " // trim(filename2)) - ! FIXME: Verify the written output + call PIO_syncfile(pio_file1) + rbuf = 0 + call PIO_read_darray(pio_file1, pio_var1_file1, iodesc, rbuf, ierr) + PIO_TF_CHECK_ERR(ierr, "Failed to read first darray : " // trim(filename1)) + + PIO_TF_CHECK_VAL((rbuf, buf), "Got wrong val") + + rbuf = 0 + call PIO_read_darray(pio_file1, pio_var2_file1, iodesc, rbuf, ierr) + PIO_TF_CHECK_ERR(ierr, "Failed to read second darray : " // trim(filename1)) + + PIO_TF_CHECK_VAL((rbuf, buf), "Got wrong val") + + call PIO_syncfile(pio_file2) + rbuf = 0 + call PIO_read_darray(pio_file2, pio_var1_file2, iodesc, rbuf, ierr) + PIO_TF_CHECK_ERR(ierr, "Failed to read first darray : " // trim(filename2)) + + PIO_TF_CHECK_VAL((rbuf, buf), "Got wrong val") call PIO_closefile(pio_file1) call PIO_closefile(pio_file2)
Trigger baseline notifies from Collections w/ API
@@ -645,6 +645,7 @@ coap_notify_observers(oc_resource_t *resource, } #endif /* OC_SECURITY */ + bool resource_is_collection = false; coap_observer_t *obs = NULL; if (resource->num_observers > 0) { #ifdef OC_BLOCK_WISE @@ -675,8 +676,21 @@ coap_notify_observers(oc_resource_t *resource, request.response = &response; request.request_payload = NULL; oc_rep_new(response_buffer.buffer, response_buffer.buffer_size); +#ifdef OC_COLLECTIONS + if (oc_check_if_collection(resource)) { + resource_is_collection = true; + if (resource->get_handler.cb) { + resource->get_handler.cb(&request, OC_IF_BASELINE, + resource->get_handler.user_data); + } else { + response_buffer.code = OC_IGNORE; + } + } else +#endif /* OC_COLLECTIONS */ + { resource->get_handler.cb(&request, resource->default_interface, resource->get_handler.user_data); + } response_buf = &response_buffer; if (response_buf->code == OC_IGNORE) { OC_DBG("coap_notify_observers: Resource ignored request"); @@ -692,7 +706,10 @@ coap_notify_observers(oc_resource_t *resource, obs = obs->next; continue; } // obs->resource != resource || endpoint != obs->endpoint - + if (resource_is_collection && obs->iface_mask != OC_IF_BASELINE) { + obs = obs->next; + continue; + } if (response.separate_response != NULL) { if (response_buf->code == oc_status_code(OC_STATUS_OK)) { coap_packet_t req[1];
framework/messaging : Unify the error return case as goto There are same error return statements. They can be unified as goto.
@@ -204,37 +204,29 @@ void messaging_run_callback(int signo, siginfo_t *data) ret = mq_getattr(recv_info->mqdes, &attr); if (ret < 0) { - MSG_FREE(recv_info); msgdbg("[Messaging] recv fail : get attribute fail.\n"); - return; + goto errout_with_recv_info; } while (1) { /* recv_packet is used for receiving message including header. */ recv_packet = (char *)MSG_ALLOC(attr.mq_msgsize); if (recv_packet == NULL) { - MSG_FREE(recv_info); msgdbg("[Messaging] recv fail : out of memory for including header.\n"); - return; + goto errout_with_recv_info; } size = mq_receive(recv_info->mqdes, (char *)recv_packet, attr.mq_msgsize, 0); if (size < 0) { msgdbg("[Messaging] recv fail : mq_receive, errno %d\n", errno); - mq_close(recv_info->mqdes); - MSG_FREE(recv_packet); - MSG_FREE(recv_info); - return; + goto errout_with_recv_packet; } /* Parsing the received data to user message buffer. */ ret = messaging_parse_packet(recv_packet, recv_info->msg->buf, recv_info->msg->buflen, &(recv_info->msg->sender_pid), &msg_type); if (ret != OK) { msgdbg("[Messaging] Not supported version, received version : %d.\n", ret); - mq_close(recv_info->mqdes); - MSG_FREE(recv_packet); - MSG_FREE(recv_info); - return; + goto errout_with_recv_packet; } /* Call user callback */ @@ -250,21 +242,26 @@ void messaging_run_callback(int signo, siginfo_t *data) if (ret != OK) { msgdbg("[Messaging] Unlink fail for async-reply, errno %d\n", errno); } - MSG_FREE(recv_info); - return; + goto errout_with_recv_info; } ret = mq_getattr(recv_info->mqdes, &attr); if (ret < 0) { msgdbg("[Messaging] recv fail : mq_getattr fail, mqdes is not correct.\n"); - mq_close(recv_info->mqdes); - MSG_FREE(recv_info); MSG_FREE(data); - return; + goto errout_with_mq_close; } else if (attr.mq_curmsgs == 0) { /* All requests are handled. Register notification again. */ messaging_set_notification(SIGMSG_MESSAGING, recv_info); break; } } + +errout_with_recv_packet: + MSG_FREE(recv_packet); +errout_with_mq_close: + mq_close(recv_info->mqdes); +errout_with_recv_info: + MSG_FREE(recv_info); + return; }
nimble/ll/css: Disallow slot change if css disabled
@@ -233,6 +233,10 @@ ble_ll_hci_vs_css_set_conn_slot(const uint8_t *cmdbuf, uint8_t cmdlen, return BLE_ERR_INV_HCI_CMD_PARMS; } + if (!ble_ll_sched_css_is_enabled()) { + return BLE_ERR_CMD_DISALLOWED; + } + slot_idx = le16toh(cmd->slot_idx); if ((slot_idx >= ble_ll_sched_css_get_period_slots()) && (slot_idx != BLE_LL_CONN_CSS_NO_SLOT)) {
board: rainier: fix accel orientation Rainier has landscape orientation, therefore needs its accelerometer base values adjusted. TEST=Rotate rainier and make sure screen orientation is not off by 90 degrees. BRANCH=None
@@ -352,8 +352,8 @@ static struct bmi160_drv_data_t g_bmi160_data; /* Matrix to rotate accelerometer into standard reference frame */ const matrix_3x3_t base_standard_ref = { - { FLOAT_TO_FP(-1), 0, 0}, { 0, FLOAT_TO_FP(-1), 0}, + { FLOAT_TO_FP(1), 0, 0}, { 0, 0, FLOAT_TO_FP(1)} };
Mention case where host does not set state context This should simply fall back to the project context.
/// /// The host is responsible to declare the context the state operation in which it is happening. /// -/// @note if an unknown context index is provided, it should be handled as -/// `CLAP_STATE_CONTEXT_PROJECT`. -/// +/// @note If an unknown context type is provided or if the host does not call +/// clap_plugin_state_context->set() at all, then the state context type should +/// be treated as `CLAP_STATE_CONTEXT_PROJECT`. #ifdef __cplusplus extern "C" {
Use LIBTOOL_LDFLAGS
@@ -14,11 +14,12 @@ RUN apt-get update && \ git clone --depth 1 https://github.com/ngtcp2/ngtcp2 && \ cd ngtcp2 && autoreconf -i && \ ./configure \ + LIBTOOL_LDFLAGS="-static-libtool-libs" \ LIBS="-ldl -pthread" \ OPENSSL_LIBS="-l:libssl.a -l:libcrypto.a" \ LIBEV_LIBS="-l:libev.a" \ JEMALLOC_LIBS="-l:libjemalloc.a" && \ - make -j$(nproc) LDFLAGS="-static-libtool-libs" && \ + make -j$(nproc) && \ strip examples/client examples/server && \ cp examples/client examples/server /usr/local/bin && \ cd .. && rm -rf ngtcp2 && \
Init coap only if there are some apps to initialize.
@@ -47,8 +47,11 @@ else: # union of default and additional apps (without duplicates) apps = ['opencoap'] apps += sorted(list(set(defaultApps+userApps))) +if userApps: appsInit = ['opencoap'] # make sure opencoap is initialized first appsInit += sorted(list(set(userApps))) +else: + appsInit = [] #===== rule to create a (temporary) openapps_dyn.c file
Improve heap memory allocation size checks to prevent overflows.
@@ -158,7 +158,7 @@ extend_space(size_t size) { char *old_usage; - if(heap_usage + size > HEAPMEM_ARENA_SIZE) { + if(size > HEAPMEM_ARENA_SIZE - heap_usage) { return NULL; } @@ -331,6 +331,11 @@ heapmem_alloc(size_t size) { chunk_t *chunk; + /* Fail early on too large allocation requests to prevent wrapping values. */ + if(size > HEAPMEM_ARENA_SIZE) { + return NULL; + } + size = ALIGN(size); chunk = get_free_chunk(size); @@ -417,6 +422,11 @@ heapmem_realloc(void *ptr, size_t size) PRINTF("%s ptr %p size %u at %s:%u\n", __func__, ptr, (unsigned)size, file, line); + /* Fail early on too large allocation requests to prevent wrapping values. */ + if(size > HEAPMEM_ARENA_SIZE) { + return NULL; + } + /* Special cases in which we can hand off the execution to other functions. */ if(ptr == NULL) { return heapmem_alloc(size);
Add m ore test cases for factorial.
@@ -135,6 +135,12 @@ describe('metacall', () => { // Factorial composition (@trgwii) /* + const fact = f.function_factorial(c => v => v); + assert.strictEqual(fact(0), 0); + assert.strictEqual(fact(1), 1); + assert.strictEqual(fact(2), 2); + assert.strictEqual(fact(3), 6); + const js_factorial = f.function_chain((x) => (n) => n == 0 ? 1 : n * x(x)(n - 1)); assert.notStrictEqual(js_factorial, undefined); assert.strictEqual(js_factorial(5), 120);
gpstart: remove erroneous Behave step A step was copied to the wrong place when resolving a merge conflict; it is unnecessary for this test and doesn't work without additional setup.
@@ -27,8 +27,6 @@ Feature: gpstart behave tests And gpstart should return a return code of 0 And all the segments are running - And the cluster is returned to a good state - @concourse_cluster @demo_cluster Scenario: gpstart starts even if a segment host is unreachable
cc2538: use Makefile.include for ieee-addr.c The file needs to be rebuilt when NODEID changes, it does not require any special build flags.
@@ -34,9 +34,7 @@ USB_SOURCEFILES += usb-core.c cdc-acm.c usb-arch.c usb-serial.c cdc-acm-descript CONTIKI_SOURCEFILES += $(CONTIKI_CPU_SOURCEFILES) $(USB_SOURCEFILES) ### Always re-build ieee-addr.o in case the command line passes a new NODEID -$(OBJECTDIR)/ieee-addr.o: ieee-addr.c FORCE | $(DEPDIR) - $(TRACE_CC) - $(Q)$(CCACHE) $(CC) $(CFLAGS) -c $< -o $@ +$(OBJECTDIR)/ieee-addr.o: FORCE ### This rule is used to generate the correct linker script LDGENFLAGS += $(CFLAGS)
ToolStatus: Remove extra flag from commit
@@ -129,7 +129,7 @@ VOID RebarLoadSettings( WS_EX_TOOLWINDOW, REBARCLASSNAME, NULL, - WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VARHEIGHT | RBS_AUTOSIZE, // | RBS_AUTOSIZE | CCS_TOP + WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | CCS_NODIVIDER | CCS_NOPARENTALIGN | RBS_VARHEIGHT, // | RBS_AUTOSIZE | CCS_TOP 0, 0, 0, 0, PhMainWndHandle, NULL,
Test document name of "1*" is rejected in a doctype declaration
@@ -6288,6 +6288,17 @@ START_TEST(test_bad_doctype_plus) } END_TEST +START_TEST(test_bad_doctype_star) +{ + const char *text = + "<!DOCTYPE 1* [ <!ENTITY foo 'bar'> ]>\n" + "<1*>&foo;</1*>"; + + expect_failure(text, XML_ERROR_INVALID_TOKEN, + "'+' in document name not faulted"); +} +END_TEST + /* * Namespaces tests. */ @@ -11756,6 +11767,7 @@ make_suite(void) tcase_add_test(tc_basic, test_bad_doctype); tcase_add_test(tc_basic, test_bad_doctype_utf16); tcase_add_test(tc_basic, test_bad_doctype_plus); + tcase_add_test(tc_basic, test_bad_doctype_star); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,
UDP: Fix session registration in lookup table This fixes a bug where packets could be sent but not received when opening an UDP connection.
@@ -880,6 +880,7 @@ session_open_cl (u32 app_wrk_index, session_endpoint_t * rmt, u32 opaque) transport_connection_t *tc; transport_endpoint_cfg_t *tep; app_worker_t *app_wrk; + session_handle_t sh; session_t *s; int rv; @@ -904,6 +905,9 @@ session_open_cl (u32 app_wrk_index, session_endpoint_t * rmt, u32 opaque) return -1; } + sh = session_handle (s); + session_lookup_add_connection (tc, sh); + return app_worker_connect_notify (app_wrk, s, opaque); }
Completions: Add namespace suggestion for `import`
@@ -305,7 +305,8 @@ end # ============= complete -c kdb -n 'not __fish_kdb_subcommand' -x -a '(__fish_kdb_print_subcommands -v)' -complete -c kdb -n '__fish_kdb_needs_namespace complete ls editor export file fstab get getmeta set 1' -x -a '(__fish_kdb_print_namespaces)' +set -l completion_function '__fish_kdb_needs_namespace complete ls editor export file fstab get getmeta import set 1' +complete -c kdb -n "$completion_function" -x -a '(__fish_kdb_print_namespaces)' complete -c kdb -n '__fish_kdb_needs_namespace cp 2' -x -a '(__fish_kdb_print_namespaces)' complete -c kdb -n '__fish_kdb_needs_plugin' -x -a '(__fish_kdb_print_plugins)' complete -c kdb -n '__fish_kdb_subcommand_convert_needs_storage_plugin' -x -a '(__fish_kdb_print_storage_plugins)'
Update CMake to correct option description
@@ -312,7 +312,7 @@ endif() ################################################################# # enables Application Domains support in nanoCLR # (default is OFF so Application Domains is NOT supported) -option(NF_FEATURE_USE_APPDOMAINS "option to use hardware RTC") +option(NF_FEATURE_USE_APPDOMAINS "option to enable Application Domains") if(NF_FEATURE_USE_APPDOMAINS) message(STATUS "Application Domains support is included")
libc/network: remove assert in freeaddrinfo() It's dangerous to call assert(). furthermore linux doens't make crash when freeaddrinfo() receive null. so libc prints error log instead of calling assert()
#ifdef CONFIG_NET_LWIP_NETDB void freeaddrinfo(FAR struct addrinfo *ai) { - DEBUGASSERT(ai != NULL); + if (!ai) { + printf("ai is null\n"); + return; + } int ret = -1; struct req_lwip_data req;
Remove 5 expected for amd-mainline-open
@@ -12,7 +12,6 @@ clang-274983 clang-274983-2 clang-279673 clang-282491-1 -clang-282491-2 clang-282491-3 clang-host-targ clang-host-targ2 @@ -54,7 +53,6 @@ flang-272343 flang-272343-2 flang-272521 flang-272534 -flang-272730-complex flang-272878 flang-273281 flang-273284 @@ -133,7 +131,6 @@ map_zero_bug MasterBarrier math_exp math_flog -math_libmextras math_max math_modff math_pow @@ -168,11 +165,9 @@ reduction_shared_array reduction_teams_distribute_parallel schedule simd -simple_ctor slices stream targ-273742 -targc-272328 targc-273738 targc-274983 targ_declare
global variable & removal of if/else in umask support dchmod
/* whether to do directory walk with stat of every ite */ static int walk_stat = 1; +/* global variable to hold umask value */ +mode_t old_mask; + /* we parse the mode string given by the user and build a linked list of * permissions operations, this defines one element in that list. This * enables the user to specify a sequence of operations separated with @@ -714,26 +717,16 @@ static void set_symbolic_bits(const struct perms* p, mfu_filetype type, mode_t* /* if assume_all flag is on then calculate the mode * based on the umask value */ if (p->assume_all) { - /* lookup current mask and set it back */ - mode_t old_mask = umask(S_IWGRP | S_IWOTH); - umask(old_mask); + /* get set of bits in current mode that we won't change + * because of umask */ + old_mode &= old_mask; - /* save the mode after parsing before masking off bits */ - mode_t assume_all_mode = *mode; - - /* only change permission bits that umask allows */ + /* mask out any bits of new mode that we shouldn't change + * due to umask */ *mode &= ~old_mask; - if (p->plus) { - /* now OR this with the old mode to not turn off any - * bits that were previously turn on */ + /* merge in bits from previous mode that had been masked */ *mode |= old_mode; - } else { - /* in the case that it was a -r,-w, etc we have to - * turn the bits back on that shouldn't be affected - * by umask */ - *mode |= assume_all_mode; - } } return; @@ -1149,6 +1142,11 @@ int main(int argc, char** argv) srclist = filtered_flist; } + /* lookup current mask and set it back before + * chmod call */ + old_mask = umask(S_IWGRP | S_IWOTH); + umask(old_mask); + /* change group and permissions */ flist_chmod(srclist, groupname, head);
Add locking for the provider_conf.c Avoid races where 2 threads attempt to configure activation of providers at the same time. E.g. via an explicit and an implict load of the config file at the same time.
@@ -22,6 +22,7 @@ DEFINE_STACK_OF(OSSL_PROVIDER) /* PROVIDER config module */ typedef struct { + CRYPTO_RWLOCK *lock; STACK_OF(OSSL_PROVIDER) *activated_providers; } PROVIDER_CONF_GLOBAL; @@ -32,6 +33,12 @@ static void *prov_conf_ossl_ctx_new(OSSL_LIB_CTX *libctx) if (pcgbl == NULL) return NULL; + pcgbl->lock = CRYPTO_THREAD_lock_new(); + if (pcgbl->lock == NULL) { + OPENSSL_free(pcgbl); + return NULL; + } + return pcgbl; } @@ -43,6 +50,7 @@ static void prov_conf_ossl_ctx_free(void *vpcgbl) ossl_provider_free); OSSL_TRACE(CONF, "Cleaned up providers\n"); + CRYPTO_THREAD_lock_free(pcgbl->lock); OPENSSL_free(pcgbl); } @@ -176,14 +184,21 @@ static int provider_conf_load(OSSL_LIB_CTX *libctx, const char *name, activate = 1; } - if (activate && !prov_already_activated(name, pcgbl->activated_providers)) { + if (activate) { + if (!CRYPTO_THREAD_write_lock(pcgbl->lock)) { + ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR); + return 0; + } + if (!prov_already_activated(name, pcgbl->activated_providers)) { /* * There is an attempt to activate a provider, so we should disable * loading of fallbacks. Otherwise a misconfiguration could mean the - * intended provider does not get loaded. Subsequent fetches could then - * fallback to the default provider - which may be the wrong thing. + * intended provider does not get loaded. Subsequent fetches could + * then fallback to the default provider - which may be the wrong + * thing. */ if (!ossl_provider_disable_fallback_loading(libctx)) { + CRYPTO_THREAD_unlock(pcgbl->lock); ERR_raise(ERR_LIB_CRYPTO, ERR_R_INTERNAL_ERROR); return 0; } @@ -191,6 +206,7 @@ static int provider_conf_load(OSSL_LIB_CTX *libctx, const char *name, if (prov == NULL) prov = ossl_provider_new(libctx, name, NULL, 1); if (prov == NULL) { + CRYPTO_THREAD_unlock(pcgbl->lock); if (soft) ERR_clear_error(); return 0; @@ -214,10 +230,11 @@ static int provider_conf_load(OSSL_LIB_CTX *libctx, const char *name, ok = 1; } } - if (!ok) ossl_provider_free(prov); - } else if (!activate) { + } + CRYPTO_THREAD_unlock(pcgbl->lock); + } else { OSSL_PROVIDER_INFO entry; memset(&entry, 0, sizeof(entry));
make sure aes256gcmsha384 is adopted
@@ -3856,7 +3856,7 @@ int main(int argc, char **argv) if (conf.ssl_zerocopy == SSL_ZEROCOPY_NON_TEMPORAL_AEAD) { static ptls_cipher_suite_t aes128gcmsha256 = {PTLS_CIPHER_SUITE_AES_128_GCM_SHA256, &ptls_non_temporal_aes128gcm, &ptls_openssl_sha256}, - aes256gcmsha384 = {PTLS_CIPHER_SUITE_AES_128_GCM_SHA256, &ptls_non_temporal_aes256gcm, + aes256gcmsha384 = {PTLS_CIPHER_SUITE_AES_256_GCM_SHA384, &ptls_non_temporal_aes256gcm, &ptls_openssl_sha384}, *non_temporal_all[] = {&aes128gcmsha256, &aes256gcmsha384, NULL}; for (size_t listener_index = 0; listener_index != conf.num_listeners; ++listener_index) {
Extend the EVP_PKEY KDF to KDF provider bridge to the FIPS provider
@@ -421,6 +421,8 @@ static const OSSL_ALGORITHM fips_keyexch[] = { { "X25519", FIPS_DEFAULT_PROPERTIES, x25519_keyexch_functions }, { "X448", FIPS_DEFAULT_PROPERTIES, x448_keyexch_functions }, #endif + { "TLS1-PRF", FIPS_DEFAULT_PROPERTIES, kdf_tls1_prf_keyexch_functions }, + { "HKDF", FIPS_DEFAULT_PROPERTIES, kdf_hkdf_keyexch_functions }, { NULL, NULL, NULL } }; @@ -459,6 +461,8 @@ static const OSSL_ALGORITHM fips_keymgmt[] = { { "ED25519", FIPS_DEFAULT_PROPERTIES, ed25519_keymgmt_functions }, { "ED448", FIPS_DEFAULT_PROPERTIES, ed448_keymgmt_functions }, #endif + { "TLS1-PRF", FIPS_DEFAULT_PROPERTIES, kdf_keymgmt_functions }, + { "HKDF", FIPS_DEFAULT_PROPERTIES, kdf_keymgmt_functions }, { NULL, NULL, NULL } };
[core] quiet indexfile warning if mod not loaded
@@ -1178,12 +1178,18 @@ static int server_main (server * const srv, int argc, char **argv) { } /* mod_indexfile should be listed in server.modules prior to dynamic handlers */ - for (i = 0; i < srv->plugins.used; ++i) { + i = 0; + for (buffer *pname = NULL; i < srv->plugins.used; ++i) { plugin *p = ((plugin **)srv->plugins.ptr)[i]; - if (buffer_is_equal_string(p->name, CONST_STR_LEN("indexfile"))) break; - if (p->handle_subrequest_start && p->handle_subrequest) { + if (buffer_is_equal_string(p->name, CONST_STR_LEN("indexfile"))) { + if (!pname) { log_error_write(srv, __FILE__, __LINE__, "SB", - "Warning: mod_indexfile should be listed in server.modules prior to mod_", p->name); + "Warning: mod_indexfile should be listed in server.modules prior to mod_", pname); + } + break; + } + if (p->handle_subrequest_start && p->handle_subrequest) { + if (!pname) pname = p->name; } }
drivers/sdcard: Update SD mounting example code for ESP8266.
@@ -15,9 +15,8 @@ Example usage on ESP8266: import machine, sdcard, os sd = sdcard.SDCard(machine.SPI(1), machine.Pin(15)) - os.umount() - os.VfsFat(sd, "") - os.listdir() + os.mount(sd, '/sd') + os.listdir('/') """
Remove outdated note about multiple calls to cipher update for associated data.
@@ -732,8 +732,6 @@ int mbedtls_cipher_reset( mbedtls_cipher_context_t *ctx ); /** * \brief This function adds additional data for AEAD ciphers. * Currently supported with GCM and ChaCha20+Poly1305. - * This must be called exactly once, after - * mbedtls_cipher_reset(). * * \param ctx The generic cipher context. This must be initialized. * \param ad The additional data to use. This must be a readable
Promise that we test with GHC 8.6.1
@@ -28,6 +28,7 @@ extra-source-files: cbits/lua-5.3.5/*.h test/lua/*.lua cabal-version: >=1.10 tested-with: GHC == 7.10.3, GHC == 8.0.2, GHC == 8.2.2, GHC == 8.4.2 + , GHC == 8.6.1 source-repository head type: git
Raise a timeout to 180s, in test 003_recovery_targets.pl. Buildfarm member chipmunk has failed twice due to taking >30s, and twenty-four runs of other members have used >5s. The test is new in v13, so no back-patch.
@@ -158,8 +158,8 @@ $node_standby->append_conf('postgresql.conf', run_log(['pg_ctl', '-D', $node_standby->data_dir, '-l', $node_standby->logfile, 'start']); -# wait up to 10 seconds for postgres to terminate -foreach my $i (0..100) +# wait up to 180s for postgres to terminate +foreach my $i (0..1800) { last if ! -f $node_standby->data_dir . '/postmaster.pid'; usleep(100_000);
net/socket: Remove lwip code at net_sockets.c lwip doesn't use group->tg_socketlist. It will be used for UDS.
@@ -115,10 +115,6 @@ void net_initlist(FAR struct socketlist *list) /* Initialize the list access mutex */ (void)sem_init(&list->sl_sem, 0, 1); - int i = 0; - for (; i < CONFIG_NSOCKET_DESCRIPTORS; i++) { - list->sl_sockets[i].conn = NULL; - } } /**************************************************************************** @@ -138,13 +134,6 @@ void net_initlist(FAR struct socketlist *list) void net_releaselist(FAR struct socketlist *list) { DEBUGASSERT(list); - /* Close each open socket in the list. */ - int idx = 0; - for (; idx < CONFIG_NSOCKET_DESCRIPTORS; idx++) { - if (list->sl_sockets[idx].conn) { - lwip_sock_close(list->sl_sockets[idx].conn); - } - } /* Destroy the semaphore */
Provide HTTP headers Gateway-Name and Gateway-Uuid in CORS response
@@ -7894,6 +7894,7 @@ int DeRestPlugin::handleHttpRequest(const QHttpRequestHeader &hdr, QTcpSocket *s stream << "Access-Control-Allow-Credentials: true\r\n"; stream << "Access-Control-Allow-Methods: POST, GET, OPTIONS, PUT, DELETE\r\n"; stream << "Access-Control-Allow-Headers: Access-Control-Allow-Origin, Content-Type\r\n"; + stream << "Access-Control-Expose-Headers: Gateway-Name, Gateway-Uuid\r\n"; stream << "Content-Type: text/html\r\n"; stream << "Content-Length: 0\r\n"; stream << "Gateway-Name: " << d->gwName << "\r\n";
VERSION bump to version 1.4.96
@@ -45,7 +45,7 @@ endif() # micro version is changed with a set of small changes or bugfixes anywhere in the project. set(SYSREPO_MAJOR_VERSION 1) set(SYSREPO_MINOR_VERSION 4) -set(SYSREPO_MICRO_VERSION 95) +set(SYSREPO_MICRO_VERSION 96) set(SYSREPO_VERSION ${SYSREPO_MAJOR_VERSION}.${SYSREPO_MINOR_VERSION}.${SYSREPO_MICRO_VERSION}) # Version of the library
nimble/ll: Refactor CSA2 prng a bit Prng calculates prn_e, but we also need prn_s (for iso subevents) which is genreated before final xor in prng. Add helper to calculate prn_s and make prng use it. Also split mam to separate helper just to make it look nicer.
@@ -232,23 +232,39 @@ ble_ll_utils_csa2_perm(uint32_t in) } #endif +static inline uint32_t +ble_ll_utils_csa2_mam(uint32_t a, uint32_t b) +{ + return (17 * a + b) % 65536; +} + static uint16_t -ble_ll_utils_csa2_prng(uint16_t counter, uint16_t ch_id) +ble_ll_utils_csa2_prn_s(uint16_t counter, uint16_t ch_id) { - uint16_t prn_e; + uint32_t prn_s; + + prn_s = counter ^ ch_id; - prn_e = counter ^ ch_id; + prn_s = ble_ll_utils_csa2_perm(prn_s); + prn_s = ble_ll_utils_csa2_mam(prn_s, ch_id); - prn_e = ble_ll_utils_csa2_perm(prn_e); - prn_e = (prn_e * 17) + ch_id; + prn_s = ble_ll_utils_csa2_perm(prn_s); + prn_s = ble_ll_utils_csa2_mam(prn_s, ch_id); - prn_e = ble_ll_utils_csa2_perm(prn_e); - prn_e = (prn_e * 17) + ch_id; + prn_s = ble_ll_utils_csa2_perm(prn_s); + prn_s = ble_ll_utils_csa2_mam(prn_s, ch_id); - prn_e = ble_ll_utils_csa2_perm(prn_e); - prn_e = (prn_e * 17) + ch_id; + return prn_s; +} + +static uint16_t +ble_ll_utils_csa2_prng(uint16_t counter, uint16_t ch_id) +{ + uint16_t prn_s; + uint16_t prn_e; - prn_e = prn_e ^ ch_id; + prn_s = ble_ll_utils_csa2_prn_s(counter, ch_id); + prn_e = prn_s ^ ch_id; return prn_e; }
Cleanup platform ISA help text and header
+// SPDX-License-Identifier: Apache-2.0 // ---------------------------------------------------------------------------- -// This confidential and proprietary software may be used only as authorised -// by a licensing agreement from Arm Limited. -// (C) COPYRIGHT 2011-2020 Arm Limited, ALL RIGHTS RESERVED -// The entire notice above must be reproduced on all authorised copies and -// copies may only be made to the extent permitted by a licensing agreement -// from Arm Limited. +// Copyright 2020 Arm Limited +// +// Licensed under the Apache License, Version 2.0 (the "License"); you may not +// use this file except in compliance with the License. You may obtain a copy +// of the License at: +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +// License for the specific language governing permissions and limitations +// under the License. // ---------------------------------------------------------------------------- /** * @brief Platform-specific function implementations. * - * This module contains functions with strongly OS-dependent implementations: - * - * * CPU count queries - * * Threading - * * Time - * - * In addition to the basic thread abstraction (which is native pthreads on - * all platforms, except Windows where it is an emulation of pthreads), a - * utility function to create N threads and wait for them to complete a batch - * task has also been provided. + * This module contains functions for querying the host extended ISA support. */ #include "astc_codec_internals.h"
Add README link to nightly builds
@@ -24,6 +24,7 @@ Find out more: * GitHub repository: https://github.com/contiki-ng/contiki-ng * Documentation: https://github.com/contiki-ng/contiki-ng/wiki * Web site: http://contiki-ng.org +* Nightly testbed runs: https://contiki-ng.github.io/testbed Engage with the community:
Update: FIFO test updated, was still containing parts from ANSNA times
void FIFO_Test() { - return; //TODO!!! puts(">>FIFO test start"); FIFO fifo = {0}; //First, evaluate whether the fifo works, not leading to overflow + int occurrence = 0; for(int i=FIFO_SIZE*2; i>=1; i--) //"rolling over" once by adding a k*FIFO_Size items { Event event1 = { .term = Narsese_AtomicTerm("test"), .type = EVENT_TYPE_BELIEF, .truth = { .frequency = 1.0, .confidence = 0.9 }, .stamp = { .evidentalBase = { i } }, - .occurrenceTime = FIFO_SIZE*2 - i*10 }; + .occurrenceTime = occurrence++ }; FIFO_Add(&event1, &fifo); } for(int i=0; i<FIFO_SIZE; i++) { assert(FIFO_SIZE-i == fifo.array[0][i].stamp.evidentalBase[0], "Item at FIFO position has to be right"); } - //now see whether a new item is revised with the correct one: - int i=3; //revise with item 10, which has occurrence time 10 - int newbase = FIFO_SIZE*2+1; - Event event2 = { .term = Narsese_AtomicTerm("test"), - .type = EVENT_TYPE_BELIEF, - .truth = { .frequency = 1.0, .confidence = 0.9 }, - .stamp = { .evidentalBase = { newbase } }, - .occurrenceTime = i*10+3 }; - FIFO fifo2 = {0}; - for(int i=0; i<FIFO_SIZE*2; i++) - { - Term zero = (Term) {0}; - FIFO_Add(&event2, &fifo2); - if(i < FIFO_SIZE && i < MAX_SEQUENCE_LEN) - { - char buf[100]; - Event *ev = FIFO_GetKthNewestSequence(&fifo2, 0, i); - sprintf(buf,"This event Term is not allowed to be zero, sequence length=%d\n",i+1); - assert(!Term_Equal(&zero, &ev->term),buf); - } - } - assert(fifo2.itemsAmount == FIFO_SIZE, "FIFO size differs"); + assert(fifo.itemsAmount == FIFO_SIZE, "FIFO size differs"); puts("<<FIFO Test successful"); }
Incremental improvements on Pin Object Class
@@ -60,8 +60,9 @@ def allDone(): class Pin(object): + def __init__(self, name = "", number = "", \ - direction = "GPIO.OUT", onval = True, offval = False, \ + direction = GPIO.OUT, onval = True, offval = False, \ pullup = None, pulldown = None, mux = None): self.name = name @@ -78,46 +79,51 @@ class Pin(object): if (self.number is False): return True + if (self.number is None): + return False - try: func = GPIO.gpio_function(self.number) print("pin %s set to %s" % (str(self.number), str(func))) - except: + if (func == GPIO.UNKNOWN): sys.exit("Unable to determine the function of the pin!. Exiting.") - try: GPIO.setup(self.number, self.direction) print("Key %s, pin %s is set to %s " % (self.name, str(self.number), str(self.direction))) sleep(0.5) - l - return True - except: - sys.exit("Unable to set the pin's function! Exiting.") - - return False - def on(self): '''Generic "assert the GPIO pin" function.''' + if (self.number is None): return False try: print("Asserting pin %s" % str(self.number)) GPIO.output(self.number, self.onval) - except: + except RuntimeError: print("%s unable to assert pin %s" % str(errstr, self.number)) return False + + except: + return False + return True + def off(self): '''Generic "turn off the GPIO pin" function.''' + if (self.number is None): return False try: GPIO.output(self.number, self.offval) + + except RuntimeError: + print("%s unable to change pin %s" % str(errstr, self.number)) + return False + except: return False
cms: Fix handling of -rctform option
@@ -484,13 +484,9 @@ int cms_main(int argc, char **argv) rr_allorfirst = 1; break; case OPT_RCTFORM: - if (rctformat == FORMAT_ASN1) { if (!opt_format(opt_arg(), OPT_FMT_PEMDER | OPT_FMT_SMIME, &rctformat)) goto opthelp; - } else { - rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient"); - } break; case OPT_CERTFILE: certfile = opt_arg(); @@ -956,7 +952,7 @@ int cms_main(int argc, char **argv) goto end; } - rcms = load_content_info(rctformat, rctin, 0, NULL, "recipient"); + rcms = load_content_info(rctformat, rctin, 0, NULL, "receipt"); if (rcms == NULL) goto end; }
hooks: remove unnecessary NULL assignment
@@ -103,7 +103,7 @@ static int initHooksSpec (KDB * kdb, Plugin * plugin, Key * errorKey) static int initHooksSendNotifications (KDB * kdb, const KeySet * config, KeySet * modules, const KeySet * contract, Key * errorKey) { - SendNotificationHook * lastHook = kdb->hooks.sendNotification = NULL; + SendNotificationHook * lastHook = kdb->hooks.sendNotification; Key * pluginsKey = keyNew ("system:/elektra/hook/notification/send/plugins", KEY_END);
[bsp][frdm-k64f] update scons config: update MDK support.
@@ -64,17 +64,16 @@ elif PLATFORM == 'armcc': TARGET_EXT = 'axf' DEVICE = ' --cpu Cortex-M4.fp ' - CFLAGS = DEVICE + ' --apcs=interwork' + CFLAGS = DEVICE + ' --c99 --apcs=interwork' AFLAGS = DEVICE LFLAGS = DEVICE + ' --info sizes --info totals --info unused --info veneers --list rtthread-k64f.map --scatter MK64F.sct' - CFLAGS += ' -I' + EXEC_PATH + '/ARM/RV31/INC' - LFLAGS += ' --libpath ' + EXEC_PATH + '/ARM/RV31/LIB' + LFLAGS += ' --keep *.o(.rti_fn.*) --keep *.o(FSymTab) --keep *.o(VSymTab)' - EXEC_PATH += '/arm/bin40/' + EXEC_PATH += '/ARM/ARMCC/bin' if BUILD == 'debug': - CFLAGS += ' --c99 -g -O0' + CFLAGS += ' -g -O0' AFLAGS += ' -g' else: CFLAGS += ' -O2'
try ctest in windows pipeline again with increased stack per thread
@@ -36,10 +36,10 @@ jobs: inputs: solution: $(BuildType)/libmimalloc.sln configuration: '$(MSBuildConfiguration)' - #- script: | - # cd $(BuildType) - # ctest --verbose --timeout 120 - # displayName: CTest + - script: | + cd $(BuildType) + ctest --verbose --timeout 120 + displayName: CTest #- script: $(BuildType)\$(BuildType)\mimalloc-test-stress # displayName: TestStress #- upload: $(Build.SourcesDirectory)/$(BuildType)
Don't use the legacy provider in test_store if its not available If we don't have the legacy provider then we avoid having to use it.
@@ -19,7 +19,7 @@ setup($test_name); my $mingw = config('target') =~ m|^mingw|; my $use_md5 = !disabled("md5"); -my $use_des = !disabled("des"); # also affects 3des and pkcs12 app +my $use_des = !(disabled("des") || disabled("legacy")); # also affects 3des and pkcs12 app my $use_dsa = !disabled("dsa"); my $use_ecc = !disabled("ec"); @@ -97,7 +97,9 @@ my @noexist_file_files = # @methods is a collection of extra 'openssl storeutl' arguments used to # try the different methods. my @methods; -push @methods, [qw(-provider default -provider legacy)]; +my @prov_method = qw(-provider default); +push @prov_method, qw(-provider legacy) unless disabled('legacy'); +push @methods, [ @prov_method ]; push @methods, [qw(-engine loader_attic)] unless disabled('dynamic-engine') || disabled('deprecated-3.0'); @@ -291,7 +293,9 @@ indir "store_$$" => sub { sub init { my $cnf = srctop_file('test', 'ca-and-certs.cnf'); my $cakey = srctop_file('test', 'certs', 'ca-key.pem'); - my @std_args = qw(-provider default -provider legacy); + my @std_args = qw(-provider default); + push @std_args, qw(-provider legacy) + unless disabled('legacy'); return ( # rsa-key-pkcs1.pem run(app(["openssl", "pkey", @std_args,
make reformat run parallel
@@ -10,12 +10,24 @@ DEV_SCRIPTS_DIR=$(dirname "$0") cd "$SOURCE" +reformat() { + reformat=$1 + shift + echo "starting $reformat ..." + "$reformat" "$@" + echo "finished $reformat" +} + OLD_IFS="$IFS" IFS=' ' for reformat in $(ls "$DEV_SCRIPTS_DIR"/reformat-*); do [ "$(basename "$reformat")" = "reformat-all" ] && continue - echo "running $reformat..." - "$reformat" "$@" + reformat "$reformat" "$@" & + PIDS="$PIDS $!" done IFS="$OLD_IFS" + +for pid in $PIDS; do + wait "$pid" +done
AAC and aptX audio-codecs * AAC and aptX audio-codecs * RFC 3640 RTP Payload Format for Transport of Elementary Streams
@@ -64,6 +64,8 @@ Distributed under BSD license - EBU ACIP (Audio Contribution over IP) Profile * Audio-codecs: + - AAC + - aptX - AMR narrowband, AMR wideband - Codec2 - G.711 @@ -314,6 +316,7 @@ zrtp ZRTP media encryption module * RFC 3016 RTP Payload Format for MPEG-4 Audio/Visual Streams * RFC 3428 SIP Extension for Instant Messaging * RFC 3711 The Secure Real-time Transport Protocol (SRTP) +* RFC 3640 RTP Payload Format for Transport of MPEG-4 Elementary Streams * RFC 3856 A Presence Event Package for SIP * RFC 3863 Presence Information Data Format (PIDF) * RFC 3951 Internet Low Bit Rate Codec (iLBC)
Update README.md Add the external instructions to get token
@@ -19,7 +19,9 @@ make echo-bot ## Run echo-bot 1. get your bot token and paste it to `bot.config` to - replace "replace-this-with-your-bot-token" + replace "replace-this-with-your-bot-token". There is a + well written instructions from [discord-irc](https://github.com/reactiflux/discord-irc/wiki/Creating-a-discord-bot-&-getting-a-token) + 2. invite your bot to your server 3. run `./echo-bot.exe` in the same folder of `bot.config`
bootutil; fix issues in parsing signature with ECDSA256.
* under the License. */ +#include <string.h> + #include "syscfg/syscfg.h" #if MYNEWT_VAL(BOOTUTIL_SIGN_EC256) @@ -89,21 +91,19 @@ static int tinycrypt_read_bigint(uint32_t i[NUM_ECC_DIGITS], uint8_t **cp, uint8_t *end) { size_t len; + uint8_t bigint[NUM_ECC_BYTES]; if (mbedtls_asn1_get_tag(cp, end, &len, MBEDTLS_ASN1_INTEGER)) { return -3; } - - for (; *cp < end; *cp = *cp + 1, len--) { - if (**cp != 0) { - break; - } - } - if (len != NUM_ECC_BYTES) { - return -1; + if (len > NUM_ECC_BYTES) { + memcpy(bigint, *cp + len - NUM_ECC_BYTES, NUM_ECC_BYTES); + } else { + memset(bigint, 0, NUM_ECC_BYTES - len); + memcpy(bigint + NUM_ECC_BYTES - len, *cp, len); } - ecc_bytes2native(i, *cp); *cp += len; + ecc_bytes2native(i, bigint); return 0; } @@ -156,10 +156,6 @@ bootutil_verify_sig(uint8_t *hash, uint32_t hlen, uint8_t *sig, int slen, return -1; } - while (sig[slen - 1] == '\0') { - slen--; - } - rc = tinycrypt_decode_sig(r, s, sig, sig + slen); if (rc) { return -1;
add support for variadic function calls
@@ -204,15 +204,50 @@ ObjClosure *compileModuleToClosure(DictuVM *vm, char *name, char *source) { } static bool call(DictuVM *vm, ObjClosure *closure, int argCount) { - if (argCount < closure->function->arity || argCount > closure->function->arity + closure->function->arityOptional) { + if (argCount < closure->function->arity) { + if ((argCount + closure->function->isVariadic) == closure->function->arity) { + // add missing variadic param ([]) + ObjList *list = newList(vm); + push(vm, OBJ_VAL(list)); + argCount++; + } else { + runtimeError(vm, "Function '%s' expected %d argument(s) but got %d.", + closure->function->name->chars, + closure->function->arity, + argCount + ); + return false; + } + } else if (argCount > closure->function->arity + closure->function->arityOptional) { + if (closure->function->isVariadic) { + int arity = closure->function->arity + closure->function->arityOptional; + // +1 for the variadic param itself + int varargs = argCount - arity + 1; + ObjList *list = newList(vm); + push(vm, OBJ_VAL(list)); + for (int i = varargs; i > 0; i--) { + writeValueArray(vm, &list->values, peek(vm, i)); + } + // +1 for the list pushed earlier on the stack + vm->stackTop -= varargs + 1; + push(vm, OBJ_VAL(list)); + argCount = arity; + } else { runtimeError(vm, "Function '%s' expected %d argument(s) but got %d.", closure->function->name->chars, closure->function->arity + closure->function->arityOptional, argCount ); - return false; } + } else if (closure->function->isVariadic) { + // last argument is the variadic arg + ObjList *list = newList(vm); + push(vm, OBJ_VAL(list)); + writeValueArray(vm, &list->values, peek(vm, 1)); + vm->stackTop -= 2; + push(vm, OBJ_VAL(list)); + } if (vm->frameCount == vm->frameCapacity) { int oldCapacity = vm->frameCapacity; vm->frameCapacity = GROW_CAPACITY(vm->frameCapacity);
doc: write about script testing
# Script Testing +## Issue + +Writing portable shell code for testing commandline tools is difficult. + +## Constraints + +- Should be able to record input/output/exit codes of command-line tools +- Should be aware of configuration settings (KDB), for example, restore it on changes + +## Assumptions + +None. + ## Considered Alternatives * http://pythonpaste.org/scripttest/ - quite long for simple things (e.g. check /bin/true needs 4 lines) - new syntax for Elektra (TCL) - additional dependency + + +## Decision + +Develop shell recorder and tutorial wrapper. + +## Argument + +## Implications + +## Related decisions + +## Notes
Select scene rather than last actor when copy/pasting a full scene
@@ -216,6 +216,10 @@ const generateSceneInsertActions = ( ); } + actions.push( + editorActions.selectScene({ sceneId: addSceneAction.payload.sceneId }) + ); + const actorMapping: Record<string, string> = actions .filter((action) => { return action.type === "entities/addActor";
error-message: improved error message in web ui
@@ -13,53 +13,31 @@ const KDB_COMMAND = process.env.KDB || 'kdb' // constants const ERR_KEY_NOT_FOUND = 'Did not find key' -const MODULE_REGEX = /Sorry, module (.*) issued.*:/ -const ERROR_REGEX = /Sorry, module.*([0-9]+):/ +const ERROR_REGEX = /Sorry, module.*?([0-9]+):/ const AT_REGEX = /At: (.*)$/ -const REASON_REGEX = /\d+:\n\t*(.*)$/ const MOUNTPOINT_REGEX = /Mountpoint: (.*)$/ const CONFIGFILE_REGEX = /Configfile: (.*)$/ -function parseError (message) { - let error = {} - for (let line of message.split('\n')) { - let res - if (res = line.match(ERROR_REGEX)) { - error.num = Number(res[1]) - } else if (currentError !== false) { - if (res = line.match(MODULE_REGEX)) { - currentError.module = res[1] - } else if (res = line.match(AT_REGEX)) { - currentError.at = res[1] - } else if (res = line.match(REASON_REGEX)) { - currentError.reason = res[1] - } else if (res = line.match(MOUNTPOINT_REGEX)) { - currentError.mountpoint = res[1] - } else if (res = line.match(CONFIGFILE_REGEX)) { - currentError.configfile = res[1] - } - } - } - return error -} - // KDBError function KDBError (message) { - this.name = 'KDBError' + this.name = 'Elektra Error' let isError = false this.details = message + let isNextMessageReason = false; for (let line of message.split('\n')) { let res + if (isNextMessageReason) { + this.reason = this.reason + '\n' + line; + isNextMessageReason = false; + } if (res = line.match(ERROR_REGEX)) { - this.num = Number(res[1]) - isError = true + this.num = Number(res[1]); + this.reason = line; + isError = true; + isNextMessageReason = true; } else if (isError) { - if (res = line.match(MODULE_REGEX)) { - this.module = res[1] - } else if (res = line.match(AT_REGEX)) { + if (res = line.match(AT_REGEX)) { this.at = res[1] - } else if (res = line.match(REASON_REGEX)) { - this.reason = res[1] } else if (res = line.match(MOUNTPOINT_REGEX)) { this.mountpoint = res[1] } else if (res = line.match(CONFIGFILE_REGEX)) {
Improved Python configure test.
# Copyright (C) NGINX, Inc. +$echo "checking for Python ..." >> $NXT_AUTOCONF_ERR + +nxt_found=no + NXT_PYTHON_CONFIG="${NXT_PYTHON}-config" -NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \ - 'import sys; \ - sys.stdout.write(sys.version[:3])'` +if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then NXT_PYTHON_INCLUDE=`${NXT_PYTHON_CONFIG} --includes` - NXT_PYTHON_LIBS=`${NXT_PYTHON_CONFIG} --ldflags` - nxt_feature="Python" nxt_feature_name=NXT_HAVE_PYTHON nxt_feature_run=no nxt_feature_incs="${NXT_PYTHON_INCLUDE}" nxt_feature_libs="${NXT_PYTHON_LIBS}" -nxt_feature_test="#include <Python.h> + nxt_feature_test=" + #include <Python.h> int main() { Py_Initialize(); @@ -27,8 +28,10 @@ nxt_feature_test="#include <Python.h> }" . auto/feature +fi if [ $nxt_found = no ]; then + $echo "checking for Python ..." $echo $echo $0: error: no Python found. $echo @@ -36,6 +39,10 @@ if [ $nxt_found = no ]; then fi +NXT_PYTHON_VERSION=`${NXT_PYTHON} -c \ + 'import sys; \ + sys.stdout.write(sys.version[:3])'` + $echo " + Python version: ${NXT_PYTHON_VERSION}"
fix compile issue on Mac using make
-# cheatcoin: Makefile; T13.656-T14.335; $DVS:time$ +# xdag: Makefile; T13.656-T14.335; $DVS:time$ SRCROOT = .. dnet = ../dnet @@ -155,7 +155,6 @@ else flags = -std=gnu11 -O3 -DDFSTOOLS -DCHEATCOIN -DNDEBUG -g -lpthread -lcrypto -lssl -lm -Wall -Wmissing-prototypes -Wno-unused-result -Wl,--export-dynamic endif -ifneq ($(OS), Darwin) ifeq ($(use_openssl_ec), false) secp256k1_i = secp256k1.o -isystem$(secp256k1)/include/ $(include_gmp) ifeq ("$(wildcard $(secp256k1)/src/libsecp256k1-config.h)","") @@ -164,12 +163,13 @@ ifneq ($(OS), Darwin) ifeq ("$(wildcard secp256k1.o)","") secp256k1_full_compile = true endif - ifeq ($(OS), Linux) + GNUmake = make - else - GNUmake = gmake - endif + ifeq ($(lgmp_installed), true) + ifeq ($(OS), Darwin) + include_gmp = -I/usr/local/opt/gmp/include -lgmp + else include_gmp = -lgmp endif endif @@ -179,10 +179,9 @@ endif all: secp256k1 xdag xdag: $(sources) $(headers) Makefile - cc -o xdag $(secp256k1_i) $(sources) $(asm_src) -DSHA256_USE_OPENSSL_TXFM -DSHA256_OPENSSL_MBLOCK -I$(SRCROOT) -I$(utils) $(flags) + cc -O3 -o xdag $(secp256k1_i) $(sources) $(asm_src) -DSHA256_USE_OPENSSL_TXFM -DSHA256_OPENSSL_MBLOCK -I$(SRCROOT) -I$(utils) $(flags) secp256k1: -ifneq ($(OS), Darwin) ifeq ($(use_openssl_ec), false) ifeq ($(lgmp_installed), false) @echo "\033[0;31mPlease install libgmp-dev to have better performance\033[0m"; @@ -199,9 +198,6 @@ ifneq ($(OS), Darwin) else @rm -f secp256k1.o endif -else - @rm -f secp256k1.o -endif clean: rm -f xdag
Add auto generation of keys to cmake
@@ -131,3 +131,24 @@ zephyr_sources(${BOOT_DIR}/zephyr/serial_adapter.c) add_subdirectory(${BOOT_DIR}/boot_serial ./boot/boot_serial) endif() + +if(NOT CONFIG_BOOT_SIGNATURE_KEY_FILE STREQUAL "") + if(IS_ABSOLUTE ${CONFIG_BOOT_SIGNATURE_KEY_FILE}) + set(KEY_FILE ${CONFIG_BOOT_SIGNATURE_KEY_FILE}) + else() + set(KEY_FILE ${MCUBOOT_DIR}/${CONFIG_BOOT_SIGNATURE_KEY_FILE}) + endif() + set(GENERATED_PUBKEY ${ZEPHYR_BINARY_DIR}/autogen-pubkey.c) + add_custom_command( + OUTPUT ${GENERATED_PUBKEY} + COMMAND + ${PYTHON_EXECUTABLE} + ${MCUBOOT_DIR}/scripts/imgtool.py + getpub + -k + ${KEY_FILE} + > ${GENERATED_PUBKEY} + DEPENDS ${KEY_FILE} + ) + target_sources(app PRIVATE "${GENERATED_PUBKEY}") +endif()
terminate scan-progress in end-scan
walts (~(put by walts) xpub w(scanned %.y)) == %- (slog ~[leaf+"Scanned xpub {<xpub>}"]) + =^ cards state (set-curr-xpub:hc xpub) + [[(give-update:hc [%scan-progress ~ ~]) cards] state] :: :: +bump-batch :: if the batch is done but the wallet isn't done scanning,
[bsp][stm32] update drv_spi.c
#include "drv_spi.h" #include "drv_config.h" +#include <string.h> //#define DRV_DEBUG #define LOG_TAG "drv.spi" @@ -276,7 +277,8 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message * if ((spi_drv->spi_dma_flag & SPI_USING_TX_DMA_FLAG) && (spi_drv->spi_dma_flag & SPI_USING_RX_DMA_FLAG)) { state = HAL_SPI_TransmitReceive_DMA(spi_handle, (uint8_t *)message->send_buf, (uint8_t *)message->recv_buf, message->length); - }else + } + else { state = HAL_SPI_TransmitReceive(spi_handle, (uint8_t *)message->send_buf, (uint8_t *)message->recv_buf, message->length, 1000); } @@ -294,6 +296,7 @@ static rt_uint32_t spixfer(struct rt_spi_device *device, struct rt_spi_message * } else { + memset(message->recv_buf, 0xff, message->length); if (spi_drv->spi_dma_flag & SPI_USING_RX_DMA_FLAG) { state = HAL_SPI_Receive_DMA(spi_handle, (uint8_t *)message->recv_buf, message->length);
ci: enable python2 lint
@@ -42,8 +42,7 @@ check_python_style: - flake8_output.txt expire_in: 1 week script: - # run it only under Python 3 (it is very slow under Python 2) - - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh -p 3.4.8 python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH + - ${IDF_PATH}/tools/ci/multirun_with_pyenv.sh python -m flake8 --config=$IDF_PATH/.flake8 --output-file=flake8_output.txt --tee --benchmark $IDF_PATH check_kconfigs: extends: .check_job_template_with_filter
TUTf32String - std::hash() specialization
@@ -83,6 +83,14 @@ struct hash<TUtf16String> { } }; +template <> +struct hash<TUtf32String> { + inline size_t operator()(const TUtf32StringBuf s) const { + return s.hash(); + } +}; + + template <class C, class T, class A> struct hash<std::basic_string<C, T, A>> { inline size_t operator()(const TStringBufImpl<C>& s) const { @@ -170,6 +178,14 @@ struct THash<TWtringBuf> { } }; +template <> +struct THash<TUtf32StringBuf> { + inline size_t operator()(const TUtf32StringBuf s) const { + return s.hash(); + } +}; + + template <class T> struct TEqualTo: public std::equal_to<T> { }; @@ -184,6 +200,11 @@ struct TEqualTo<TUtf16String>: public TEqualTo<TWtringBuf> { using is_transparent = void; }; +template <> +struct TEqualTo<TUtf32String> : public TEqualTo<TUtf32StringBuf> { + using is_transparent = void; +}; + template <class TFirst, class TSecond> struct TEqualTo<std::pair<TFirst, TSecond>> { template <class TOther> @@ -232,6 +253,11 @@ struct TLess<TUtf16String>: public TLess<TWtringBuf> { using is_transparent = void; }; +template <> +struct TLess<TUtf32String> : public TLess<TUtf32StringBuf> { + using is_transparent = void; +}; + template <class T> struct TGreater: public std::greater<T> { }; @@ -245,3 +271,8 @@ template <> struct TGreater<TUtf16String>: public TGreater<TWtringBuf> { using is_transparent = void; }; + +template <> +struct TGreater<TUtf32String> : public TGreater<TUtf32StringBuf> { + using is_transparent = void; +};
spec: fix type error
@@ -585,7 +585,7 @@ static void validateWildcardSubs (KeySet * ks, Key * key, Key * specKey) ksDel (ksCopy); Key * cur; - long subCount = 0; + kdb_long_long_t subCount = 0; while ((cur = ksNext (subKeys)) != NULL) { if (keyIsDirectBelow (parent, cur))
hv: assign: remove added ptirq entries if fails to add all When adding ptirq entries, either successes with all number of entries added or fails with none entries addes. So remove added ptirq entries if error occurs during the process. Acked-by: Eddie Dong
@@ -755,6 +755,10 @@ int32_t ptirq_add_msix_remapping(struct acrn_vm *vm, uint16_t virt_bdf, vector_added++; } + if (vector_added != vector_count) { + ptirq_remove_msix_remapping(vm, virt_bdf, vector_added); + } + return (vector_added == vector_count) ? 0 : -ENODEV; }
btc: fix warning link style
@@ -56,9 +56,10 @@ export default class Warning extends Component { Always ensure that the checksum of the wallet matches that of the wallet's repo. </Text> <br/> - <Anchor color="white" fontWeight="bold" fontSize={1} style={{textDecoration: 'underline'}} - href="https://urbit.org/bitcoin-wallet" target="_blank"> + <Anchor href="https://urbit.org/bitcoin-wallet" target="_blank"> + <Text color="white" fontWeight="bold" fontSize={1} style={{textDecoration:'underline'}}> Learn more on urbit.org + </Text> </Anchor> </Col> <Button children="I Understand"
pkg/gadgets: Use CO-RE tracer and switch back to bcc for profile.
@@ -17,11 +17,14 @@ package profile import ( "fmt" + log "github.com/sirupsen/logrus" + gadgetv1alpha1 "github.com/kinvolk/inspektor-gadget/pkg/apis/gadget/v1alpha1" "github.com/kinvolk/inspektor-gadget/pkg/gadgets" - "github.com/kinvolk/inspektor-gadget/pkg/gadgets/profile/types" "github.com/kinvolk/inspektor-gadget/pkg/gadgets/profile/tracer" + coretracer "github.com/kinvolk/inspektor-gadget/pkg/gadgets/profile/tracer/core" standardtracer "github.com/kinvolk/inspektor-gadget/pkg/gadgets/profile/tracer/standard" + "github.com/kinvolk/inspektor-gadget/pkg/gadgets/profile/types" ) type Trace struct { @@ -103,11 +106,20 @@ func (t *Trace) Start(trace *gadgetv1alpha1.Trace) { KernelStackOnly: kernelStackOnly, } + t.tracer, err = coretracer.NewTracer(t.resolver, config, trace.Spec.Node) + if err != nil { + trace.Status.OperationWarning = fmt.Sprint("failed to create core tracer. Falling back to standard one") + + // fallback to standard tracer + log.Infof("Gadget %s: falling back to standard tracer. CO-RE tracer failed: %s", + trace.Spec.Gadget, err) + t.tracer, err = standardtracer.NewTracer(config, trace.Spec.Node) if err != nil { trace.Status.OperationError = fmt.Sprintf("failed to create tracer: %s", err) return } + } t.started = true trace.Status.Output = ""