From 99b1228db48f9b35b15df2d9e61227b71921a04d Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 10 Oct 2023 09:35:55 -0700 Subject: [PATCH 1/4] Onboard to CI-CD changes --- .github/.cSpellWords.txt | 34 +++++++++++++++++ .github/CONTRIBUTING.md | 63 ++++++++++++++++++++++++++++++++ .github/workflows/formatting.yml | 23 ++++++++++++ cspell.config.yaml | 31 ++++++++++++++++ 4 files changed, 151 insertions(+) create mode 100644 .github/.cSpellWords.txt create mode 100644 .github/CONTRIBUTING.md create mode 100644 .github/workflows/formatting.yml create mode 100644 cspell.config.yaml diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt new file mode 100644 index 0000000..7fca1fb --- /dev/null +++ b/.github/.cSpellWords.txt @@ -0,0 +1,34 @@ +CBMC +CBOR +CMOCK +CMock +CSDK +Cmock +Coverity +DCMOCK +DNDEBUG +DUNITY +MISRA +MQTT +Misra +UNACKED +UNSUB +UNSUBACK +Wunused +cbmc +cbor +cmock +coremqtt +coverity +ctest +getpacketid +isystem +lcov +misra +mypy +pylint +pytest +pyyaml +sinclude +unsubscriptions +utest diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..e84e0ed --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,63 @@ +# Contributing Guidelines + +Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional +documentation, we greatly value feedback and contributions from our community. + +Please read through this document before submitting any issues or pull requests to ensure we have all the necessary +information to effectively respond to your bug report or contribution. + + +## Reporting Bugs/Feature Requests + +We welcome you to use the GitHub issue tracker to report bugs or suggest features. + +When filing an issue, please check [existing open](https://github.com/FreeRTOS/coreMQTT/issues), or [recently closed](https://github.com/FreeRTOS/coreMQTT/issues?q=is%3Aissue+is%3Aclosed), issues to make sure somebody else hasn't already +reported the issue. Please try to include as much information as you can. Details like these are incredibly useful: + +* A reproducible test case or series of steps +* The version of our code being used +* Any modifications you've made relevant to the bug +* Anything unusual about your environment or deployment + + +## Contributing via Pull Requests +Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: + +1. You are working against the latest source on the *main* branch. +1. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. +1. You open an issue to discuss any significant work - we would hate for your time to be wasted. + +To send us a pull request, please: + +1. Fork the repository. +1. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change. +1. Ensure that your contributions conform to the [style guide](https://www.freertos.org/FreeRTOS-Coding-Standard-and-Style-Guide.html). +1. Format your code with uncrustify, using the config available in [FreeRTOS/CI-CD-Github-Actions](https://github.com/FreeRTOS/CI-CD-Github-Actions/blob/main/formatting/uncrustify.cfg). +1. Ensure local tests pass. +1. Commit to your fork using clear commit messages. +1. Send us a pull request, answering any default questions in the pull request interface. +1. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation. + +GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and +[creating a pull request](https://help.github.com/articles/creating-a-pull-request/). + + +## Finding contributions to work on +Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/FreeRTOS/coreMQTT/labels?q=help+wanted) issues is a great place to start. + + +## Code of Conduct +This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct). +For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact +opensource-codeofconduct@amazon.com with any additional questions or comments. + + +## Security issue notifications +If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](https://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue. + + +## Licensing + +See the [LICENSE](../LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution. + +We may ask you to sign a [Contributor License Agreement (CLA)](https://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes. diff --git a/.github/workflows/formatting.yml b/.github/workflows/formatting.yml new file mode 100644 index 0000000..04786ba --- /dev/null +++ b/.github/workflows/formatting.yml @@ -0,0 +1,23 @@ +name: Format Pull Request Files + +on: + issue_comment: + types: [created] + +env: + bashPass: \033[32;1mPASSED - + bashInfo: \033[33;1mINFO - + bashFail: \033[31;1mFAILED - + bashEnd: \033[0m + +jobs: + Formatting: + name: Run Formatting Check + if: ${{ github.event.issue.pull_request && + ( ( github.event.comment.body == '/bot run uncrustify' ) || + ( github.event.comment.body == '/bot run formatting' ) ) }} + runs-on: ubuntu-20.04 + steps: + - name: Apply Formatting Fix + uses: FreeRTOS/CI-CD-Github-Actions/formatting-bot@main + id: check-formatting diff --git a/cspell.config.yaml b/cspell.config.yaml new file mode 100644 index 0000000..911ce1d --- /dev/null +++ b/cspell.config.yaml @@ -0,0 +1,31 @@ +--- +$schema: https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json +version: '0.2' +# Allows things like stringLength +allowCompoundWords: true + +# Read files not to spell check from the git ignore +useGitignore: true + +# Language settings for C +languageSettings: + - caseSensitive: false + enabled: true + languageId: c + locale: "*" + +# Add a dictionary, and the path to the word list +dictionaryDefinitions: + - name: freertos-words + path: '.github/.cSpellWords.txt' + addWords: true + +dictionaries: + - freertos-words + +# Paths and files to ignore +ignorePaths: + - 'dependency' + - 'docs' + - 'ThirdParty' + - 'History.txt' From 65bd3997f6102c225123d439457e9152ff28413f Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Tue, 12 Dec 2023 10:22:06 -0500 Subject: [PATCH 2/4] Update the ci.yml file, swap from lexicon.txt to cSpellWords.txt, use new version of CI workflow file --- .github/.cSpellWords.txt | 32 +- .github/workflows/ci.yml | 89 ++-- lexicon.txt | 936 --------------------------------------- 3 files changed, 45 insertions(+), 1012 deletions(-) delete mode 100644 lexicon.txt diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt index 7fca1fb..f5d6610 100644 --- a/.github/.cSpellWords.txt +++ b/.github/.cSpellWords.txt @@ -1,34 +1,34 @@ +cbmc CBMC +cbor CBOR -CMOCK -CMock -CSDK +cmock Cmock +CMock +CMOCK +coremqtt +coverity Coverity +CSDK +ctest DCMOCK DNDEBUG DUNITY -MISRA -MQTT -Misra -UNACKED -UNSUB -UNSUBACK -Wunused -cbmc -cbor -cmock -coremqtt -coverity -ctest getpacketid isystem lcov misra +Misra +MISRA +MQTT mypy pylint pytest pyyaml sinclude +UNACKED +UNSUB +UNSUBACK unsubscriptions utest +Wunused diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fbab545..8ed36ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,80 +7,49 @@ on: branches: ["**"] jobs: - spell-check: - runs-on: ubuntu-latest + formatting: + runs-on: ubuntu-20.04 steps: - - name: Checkout Parent Repo - uses: actions/checkout@v2 - with: - ref: main - repository: FreeRTOS/CI-CD-Github-Actions - path: actions - - name: Clone This Repo - uses: actions/checkout@v2 - with: - ref: ${{ github.event.pull_request.head.sha }} - path: ./NXPRef - - name: Install spell - run: | - sudo apt-get install spell - sudo apt-get install util-linux - - name: Check spelling - run: | - PATH=$PATH:actions/spellings/tools - # Make sure that the portable directory is not included in the spellcheck. - sed -i "s/-iname \\\\\*.\[ch\] -o/-not -path \\\*Middleware\\\\\/NXP\\\* -iname \\\\\*.\[ch\] -o/g" actions/spellings/tools/find-unknown-comment-words - find-unknown-comment-words --directory NXPRef/ --lexicon NXPRef/lexicon.txt - if [ "$?" = "0" ]; then - exit 0 - else - exit 1 - fi + - uses: actions/checkout@v3 + - name: Check Formatting of Files + uses: FreeRTOS/CI-CD-Github-Actions/formatting@main + + spell-check: + runs-on: ubuntu-latest + steps: + - name: Clone This Repo + uses: actions/checkout@v3 + - name: Run spellings check + uses: FreeRTOS/CI-CD-Github-Actions/spellings@main + link-verifier: runs-on: ubuntu-latest steps: - name: Clone This Repo - uses: actions/checkout@v2 - - name: Run link verifier + uses: actions/checkout@v3 + - name: Link Verification uses: FreeRTOS/CI-CD-Github-Actions/link-verifier@main - with: - path: ./ - include-file-types: .c,.h,.md,.dox - exclude-dirs: NXP - formatting: + verify-manifest: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - name: Install Uncrustify - run: sudo apt-get install uncrustify - - name: Run Uncrustify - run: | - uncrustify --version - find -not -path ".*/Middleware/NXP*" -iname "*.[hc]" -exec uncrustify --check -c ./uncrustify.cfg {} + - if [ "$?" = "0" ]; then - exit 0 - else - echo -e "\033[31;1;43mFormatting check (using Uncrustify) failed...\033[0m" - exit 1 - fi - - name: Check For Trailing Whitespace - run: | - set +e - grep --exclude-dir="NXP" --exclude="README.md" -rnI -e "[[:blank:]]$" . - if [ "$?" = "0" ]; then - echo "Files have trailing whitespace." - exit 1 - else - exit 0 - fi + - uses: actions/checkout@v3 + with: + submodules: true + fetch-depth: 0 + + - name: Run manifest verifier + uses: FreeRTOS/CI-CD-GitHub-Actions/manifest-verifier@main + with: + path: ./ + fail-on-incorrect-version: true git-secrets: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Checkout awslabs/git-secrets - uses: actions/checkout@v2 + uses: actions/checkout@v3 with: repository: awslabs/git-secrets ref: master diff --git a/lexicon.txt b/lexicon.txt deleted file mode 100644 index 3586d9f..0000000 --- a/lexicon.txt +++ /dev/null @@ -1,936 +0,0 @@ -acceptmbox -accesspermission -ack -acked -acks -acks -adam -adam -addr -addr -addtogroup -aes -aes -aeskey -aesni -ahb -ahbwritewaitinterval -ahbwritewaitunit -aka -alpn -alt -alt -amazonaws -api -api -apis -apis -app -applet -applets -arcfour -ardseqindex -ardseqnumber -arp -asa -asf -asm -asn -ats -auth -auth -authmode -autogenerated -awrseqindex -awrseqnumber -aws -aws -ba -backoff -backtrace -basicdef -behaviour -bi -bignum -bignum -bkpt -blocksize -blocktimems -bluetooth -bo -bootable -bootable -bootloader -bootloader -bootrom -bootutil -br -breif -bsd -bsp -buf -bugfix -busybitpolarity -busyoffset -bytesread -bytestorecv -bytestosend -ca -caam -cacheable -callfrominitboot -calloc -calloc -cas -casper -cbc -cbmc -cbor -ccm -ccm -cert -certificatehandle -certprofile -certs -cexpectednumberofparameters -cfb -chinese -cinputbuffer -ciphersuite -ciphersuites -cli -clientcert -clienthello -clientidentifierlength -clienttoken -clk -cmac -cmac -cmake -cmsis -co -columnaddresswidth -columnspace -com -commandbufferlength -commandinterval -config -config -configcmdargs -configcmdenable -configcmdseqs -configmodetype -configprintf -configs -configurat -connack -connectionsarraylength -consoleio -consoleio -const -const -constantspage -controllermiscoption -copybrief -coreid -coremqtt -coutputbuffer -coverity -cpu -crl -crlf -crls -crt -crypto -crypto -cryptoapi -crytpo -csholdtime -csholdtime -csi -csi -csinterval -csintervalunit -cspadsettingoverride -csr -csrs -csrs -cssetuptime -cssetuptime -ctr -ctx -customisation -customlut -datapadsettingoverride -datasheet -datasize -datavalidtime -dcd -dcd -dcdx -dcp -ddr -debugenable -def -defgroup -deinit -del -denom -der -des -des -deselect -deserialize -deserialized -desfire -detectmetricsmessagesspec -dev -developerguide -deviceconfig -devicemodearg -devicemodecfgenable -devicemodeseq -devicemodetpe -devicemodetype -devicetype -dfu -dh -dhcp -dhe -dhm -dhm -didn -diff -diffie -diffs -disableexec -div -dll -dma -dns -doesn -dpi -dqs -dqspadsettingoverride -dsa -dstaddr -dtls -dunkels -eagain -eap -ec -ecc -ecdh -ecdh -ecdhe -ecdsa -ecdsa -ecjpake -ecjpake -eckey -ecp -ecp -edwards -eg -eg -enableclock -enablewordaddress -endian -endif -enet -enet -enet -enum -enum -enums -eof -eol -errno -ethernet -ethernet -evk -evkb -ewouldblock -exceeed -exe -extendedkeyusage -fastscp -fdata -filexref -fips -flashsize -flashstatectx -flashxfer -flexspi -flexspi -flexspi -flexspi -flexspirootclk -fnet -fopen -fout -fprintf -freertos -freertos -freertos -freertosconfig -freescale -fsl -galois -gcc -gcc -gcm -gcm -gdir -geerator -gf -ghz -github -glibc -globalinfo -gmtime -grp -gte -hab -hal -halfclkfornonreadcmd -hashcrypt -hashcrypt -havege -havege -hci -hed -hellman -helloverifyrequest -hmac -hostcrypto -hsm -html -http -http -https -hw -hw -hyperbus -hyperflash -hyst -hz -ia -iap -iar -ic -icmp -ie -ietf -ifdef -ifndef -igmp -ignoreack -inc -ingroup -init -initialised -inputsize -int -intel -interoperate -io -iomuxc -iot -iot -iot -ip -ip -ipcmdserialclkfreq -ipg -ipriority -isbufferable -iscacheable -isp -isr -isshareable -istacksize -isuniformblocksize -jacobi -jitp -jitr -json -json -kbyte -kbytes -kconfig -keystore -keyusage -khz -ksdk -ksdk -kv -kvstore -lcdif -lcdif -len -libc -linux -ll -lnumtries -localip -lookuptable -loopback -loopdivider -lpathcount -lpc -lpspi -lpspi -ltc -lts -lut -lut -lutcustomseq -lutcustomseqenable -lwip -lwip -lwip -lwip -lwipopts -mac -majorversion -malloc -malloc -maxium -mbed -mbed -mbedcrypto -mbedpkaltctx -mbedtls -mbedtls -mbedtls -mbedtls -mbedts -mbox -mcp -mcu -mcu -mcuboot -mcuboot -mcuboot -mcuxpresso -md -mdio -mebdtls -memaddr -memconfig -memcrl -memp -merkle -metadata -metricscollectorbadparameter -metricscollectorcollectionfailed -metricscollectorsuccess -mfg -mflash -mhz -microcontroller -mifare -minorversion -mis -misc -misra -mmcau -montgomery -mosquitto -mosquitto -mpi -mpis -mpu -mqs -mqtt -mqtt -mqttbadparameter -mqttconnected -mqttnotconnected -mqttsuccess -msg -msgsize -msvc -mtu -multithread -mutex -mutex -mutexes -mux -mynewt -nand -neable -necesarily -needexitnocmdmode -needrestorenocmdmode -netconn -netconn -netconns -netif -netifapi -networkcredentials -nfc -ni -nist -nocmd -noncache -noninfringement -nonoadjacent -nop -nordic -ns -num -nv -nvm -nxp -oaep -oid -oid -oids -ok -ok -oliveri -oliveri -onboard -openssl -opi -optimisation -org -os -os -osc -ota -ota -otamqttsuccess -otapalsuccess -outfreq -outpubufferlength -outter -overriden -paased -packetid -pactopic -pagesize -pake -palfilecontext -palpnprotos -param -passwordsize -pbe -pbuf -pbuf -pbuffer -pbufs -pcb -pcbs -pccmdintprocesscommand -pccommand -pccommandinput -pccommandstring -pcdestination -pcertificatepath -pchelpstring -pcks -pclabelname -pclientcertlabel -pclientidentifier -pcname -pcommandbuffer -pcommandbufferindex -pcommandcontext -pcommandtorelease -pcommandtosend -pconsoleinput -pcoutputbuffer -pcservercertificate -pcthingname -pctopic -pctopicfilter -pcurrpcb -pcwritebuffer -pdata -pdf -pdfail -pdfalse -pdpass -pdtrue -pem -pem -perclk -periph -periphmux -pestablishedconnection -pfd -pfilecontext -phostname -phy -phy -pinconfig -pingreq -pirng -pk -pk -pkcs -pkha -pki -pkparse -pkwrite -pleace -pll -pll -plls -pmqttagentcontext -pmsg -pmsgctx -pnetworkcontext -pnetworkcredentials -po -posix -postdivider -poutconnectionsarray -poutnetworkstats -poutnumestablishedconnections -poutnumtcpopenports -poutnumudpopenports -poutputbuffer -pouttcpportsarray -poutudpportsarray -poweron -ppassword -pprivatekeylabel -ppublishinfo -ppvcontext -ppxidletaskstackbuffer -ppxtimertaskstackbuffer -pragma -pre -pre -preceivedcommand -preperiph -presigned -prf -printf -printf -priv -privkey -privkeyinfo -prootca -prvgeneraterandombytes -prvgettimems -prvincomingpublish -prvincomingpublishupdateacceptedcallback -prvincomingpublishupdaterejectedcallback -prvupdateacceptedcallback -prvupdatedeltacallback -prvupdaterejectedcallback -psa -psignature -psk -pss -psslcontext -ptaskparam -pthread -ptopic -ptopicfilter -ptr -puback -puback -pubsub -pucdata -puchash -pucmsg -pucpayload -pucrandom -pucreadbuffer -pucreceivebuffer -pucsig -pulflags -pulnotifiedvalue -pusername -pval -pvalue -pvarg -pvcallbackcontext -pvcallercontext -pvcontext -pvctx -pvincomingpublishcallbackcontext -pvmetricsreport -pvparam -pvparameters -pvportcalloc -pvportmalloc -pvrng -pxbuffer -pxcerthandle -pxcertificate -pxcertificatecontext -pxcommand -pxcommandcontext -pxcommandinterpreter -pxcommandtoregister -pxctx -pxmqttcontext -pxnetworkcontext -pxnetworkrecv -pxnetworksend -pxnext -pxparams -pxpublishcallback -pxpublishinfo -pxreturninfo -pxsiglen -pxsubscriptioncontext -pxthread -pxtlscontext -qos -qos -qos -qos -qpi -rand -rc -rc -readsampleclksrc -reasonnable -receivetimeoutms -recv -recvmbox -recvstatus -remoteip -reseed -resp -resubscribe -resubscribe -resubscribed -ret -retrun -rfc -ripemd -rng -rom -rootca -rootcasize -rsa -rsa -rsaes -rsassa -rsp -rtc -rtos -sbl -sck -scl -sclkpadsettingoverride -scp -scsv -sda -sdcard -sdk -sdr -sdram -se -se -sectorsize -seedfile -sel -sem -semc -semc -semihosted -semihosting -semihosting -sendtimeoutms -seperator -seqid -seqnum -serialclkfreq -serialnortype -sflashpadtype -sha -shareability -signaturelength -simulatenously -simulateously -sizeof -smartcard -sni -snprintf -spdif -spdif -spdx -specifiedecdomain -spi -sram -src -ssl -ssl -sss -sss -sssftr -std -stderr -stdint -stdlib -stefano -stefano -str -struct -struct -suback -suback -sublicense -subregiondisable -sw -swaping -swedish -sys -sys -sysflash -systemcoreclock -systick -tcp -tcp -tcpip -tcpportsarraylength -tdes -tf -tfm -thingname -thingname -thingname -thingname -threadwrapper -timedout -timeoutinms -timeoutms -tinycrypt -tls -tls -tlserrors -tlv -tlvs -todo -topicfilter -topicfilterlength -topiclen -topicname -topicnamelength -tpm -trng -tx -txd -txt -typeextfield -uart -uart -uccount -ucqos -ucqos -udp -udp -udpportsarraylength -uihashlen -ulbytesreceived -ulbytessent -ulclienttoken -ulcurrentversion -ulglobalentrytimems -ullocalipaddr -ulnextsubscribemessageid -ulnotification -ulnotificationvalue -ulnumpubsubtasks -ulpacketsreceived -ulpacketssent -ulrecievedtoken -ulremoteipaddr -ulservercertificatelength -ulsize -ulvaluelen -unix -unsecure -updatable -upgradable -upto -urandom -usb -userid -usernamesize -uslocalport -usremoteport -ustopicfilterlength -utils -uxpriority -uxstacksize -vapplicationgetidletaskmemory -vapplicationgettimertaskmemory -varifies -ve -vloggingprintf -vportfree -vsimplesubscribepublishtask -vsnprintf -waittimecfgcommands -wasn -wasn -weierstrass -whan -www -x-amzn-mqtt-ca -xclass -xcleansession -xdatalength -xecparams -xecpoint -xhelpcommand -xip -xip -xisreconnect -xlength -xmanageresubscription -xmbedsslconfig -xmbedsslctx -xmdalg -xmetricsreportlength -xmodulus -xmsglength -xn -xnetworkrecv -xnetworksend -xotapalresetdevice -xoutputbufferlen -xparameternumber -xpayloadlength -xportsystickhandler -xpublicexponent -xpublickeytype -xqos -xrandomlength -xreadlength -xreceivelength -xresult -xreturn -xreturned -xreturnstatus -xsession -xstatetowait -xtal -xtaskcreate -xtasknotify -xtea -xtea -xtemplate -xthingnamelength -xtickstowait -xtlschandshakesuccessful -xtopicfilterlength -xtopiclength -xtrue -xwritebufferlen -yaml -yotta -yotta -zlib -zlib From cde225eff18a2f72ab440ece4c5212dcdfa1ee77 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 5 Jan 2024 14:15:47 -0500 Subject: [PATCH 3/4] Add new common words to the cSpellWordList.txt --- .github/.cSpellWords.txt | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt index f5d6610..f2aa350 100644 --- a/.github/.cSpellWords.txt +++ b/.github/.cSpellWords.txt @@ -12,6 +12,9 @@ Coverity CSDK ctest DCMOCK +decihours +Decihours +DECIHOURS DNDEBUG DUNITY getpacketid @@ -22,13 +25,22 @@ Misra MISRA MQTT mypy +nondet +Nondet +NONDET pylint pytest pyyaml sinclude UNACKED +unpadded +Unpadded +UNPADDED UNSUB UNSUBACK unsubscriptions utest +vect +Vect +VECT Wunused From 659226a223b671e58ad6970294aceb49e2486a92 Mon Sep 17 00:00:00 2001 From: Soren Ptak Date: Fri, 5 Jan 2024 16:14:47 -0500 Subject: [PATCH 4/4] Fix spelling mistakes in the repo --- .github/.cSpellWords.txt | 60 +++++++++++++++++++ GSG.md | 14 ++--- .../lwip_osal/include/lwipopts_freertos.h | 4 +- Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c | 6 +- .../NXP/hostLib/a71ch/ex_hlse/ex_hlse_cert.c | 2 +- .../hostLib/a71ch/ex_hlse/ex_hlse_ecc_nohc.c | 6 +- .../NXP/hostLib/a71ch/src/a71ch_crypto_ecc.c | 2 +- .../NXP/hostLib/libCommon/smCom/sci2c.c | 2 +- .../NXP/hostLib/libCommon/smCom/sci2c.h | 4 +- .../NXP/hostLib/tstUtil/tstHostCrypto.c | 2 +- Middleware/NXP/hostLib/tstUtil/tst_sm_util.h | 2 +- .../NXP/sss/src/se05x/fsl_sss_se05x_apis.c | 4 +- cspell.config.yaml | 2 + examples/common/mqtt_agent/mqtt_agent_task.h | 4 +- .../defender/include/lwipopts.h | 4 +- .../evkbmimxrt1060/pubsub/include/lwipopts.h | 4 +- .../evkbmimxrt1060/shadow/include/lwipopts.h | 4 +- .../evkbmimxrt1060/test/include/lwipopts.h | 4 +- 18 files changed, 96 insertions(+), 34 deletions(-) diff --git a/.github/.cSpellWords.txt b/.github/.cSpellWords.txt index f2aa350..53a3203 100644 --- a/.github/.cSpellWords.txt +++ b/.github/.cSpellWords.txt @@ -1,3 +1,5 @@ +acceptmbox +BBOOL cbmc CBMC cbor @@ -6,6 +8,7 @@ cmock Cmock CMock CMOCK +CMSIS coremqtt coverity Coverity @@ -17,25 +20,82 @@ Decihours DECIHOURS DNDEBUG DUNITY +ecdhctx +ECKEY +EKVB +EVKB +evkbmimxrt +evkmimxrt +fromisr getpacketid +IPSR isystem +JITP +Jitr +JITR +KITP +kvstore +Kvstore +KVStore +KVSTORE lcov +LWIPOPTS +mbed +mcuboot +MCUX +MCUXpresso +MEMP +mflash +Mflash +MFlash +MFLASH +MIMXRT misra Misra MISRA +mosquitto MQTT +mqttexample mypy +netif +NETIF +NOASSERT nondet Nondet NONDET +noout +NVIC +Oliveri +otaexample +pbufs +PBUFS +pval pylint pytest pyyaml +RECVMBOX sinclude +Stefano +submoduled +sysclk +Sysclk +SysClk +SYSClk +SYSCLK +sysclock +Sysclock +SysClock +SYSCLOCK +Tera +Teraterm +TLSC UNACKED unpadded Unpadded UNPADDED +unprotect +Unprotect +Unprotected UNSUB UNSUBACK unsubscriptions diff --git a/GSG.md b/GSG.md index ba101d4..cbd5160 100644 --- a/GSG.md +++ b/GSG.md @@ -241,7 +241,7 @@ in MAC or Linux machines. ### 3.3 Preparing an Executable Image Sent to the Device via OTA -For a succesful OTA, follow the below steps to prepare the executable image: +For a successful OTA, follow the below steps to prepare the executable image: 1. The version number of the image sent via OTA must be higher than that already running on the device, so temporarily update the executable image's version number.\ 2. Build the executable image.\ 3. Sign the executable image with the key used by the bootloader to validate the image.\ @@ -468,19 +468,19 @@ perform OTA updates. 1. Create an ECDSA code-signing private key. ``` openssl genpkey -algorithm EC -pkeyopt ec_paramgen_curve:P-256 -pkeyopt \ - ec_param_enc:named_curve -outform PEM -out ecdsasigner.key + ec_param_enc:named_curve -outform PEM -out ecdsa_signer.key ``` 1. Create an ECDSA code-signing certificate. ``` openssl req -new -x509 -config cert_config.txt -extensions my_exts -nodes \ - -days 365 -key ecdsasigner.key -out ecdsasigner.crt + -days 365 -key ecdsa_signer.key -out ecdsa_signer.crt ``` 1. Import the code-signing certificate, private key, and certificate chain into the AWS Certificate Manager. ``` - aws acm import-certificate --certificate fileb://ecdsasigner.crt --private-key fileb://ecdsasigner.key + aws acm import-certificate --certificate file://ecdsa_signer.crt --private-key file://ecdsa_signer.key ``` 1. Confirm the ARN for your certificate. You need this ARN when you create an OTA update job. @@ -490,13 +490,13 @@ perform OTA updates. 1. Get the ECDSA public key from the code signing credentials generated in 6.2: ``` - openssl ec -in ecdsasigner.key -pubout -outform PEM -out ecdsasigner-pub-key.pem + openssl ec -in ecdsa_signer.key -pubout -outform PEM -out ecdsa_signer-pub-key.pem ``` -1. Confirm that the file `esdsaigner-pub-key.pem` has been created correctly. +1. Confirm that the file `ecdsa_signer-pub-key.pem` has been created correctly. ![Image](https://user-images.githubusercontent.com/45887168/161103614-dd30b4a0-de7c-49d3-8567-a5054a446080.png) -1. Open the target MCUExpressoIDE aws_iot_pubsub project. To switch to device provisioning mode +1. Open the target MCUXpressoIDE aws_iot_pubsub project. To switch to device provisioning mode set `appmainPROVISIONING_MODE` to `1`, recompile and download the firmware to the board. 1. On the terminal CLI, run the following command: diff --git a/Middleware/FreeRTOS/lwip_osal/include/lwipopts_freertos.h b/Middleware/FreeRTOS/lwip_osal/include/lwipopts_freertos.h index 024cd89..d061bb6 100644 --- a/Middleware/FreeRTOS/lwip_osal/include/lwipopts_freertos.h +++ b/Middleware/FreeRTOS/lwip_osal/include/lwipopts_freertos.h @@ -102,7 +102,7 @@ * per active UDP "connection". */ #define MEMP_NUM_UDP_PCB 8 -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP +/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP * connections. */ #define MEMP_NUM_TCP_PCB 32 @@ -114,7 +114,7 @@ * segments. */ #define MEMP_NUM_TCP_SEG 255 -/* MEMP_NUM_ARP_QUEUE: the number of simulateously queued outgoing +/* MEMP_NUM_ARP_QUEUE: the number of simultaneously queued outgoing * packets (pbufs) that are waiting for an ARP request (to resolve * their destination address) to finish. (requires the ARP_QUEUEING option) */ #define MEMP_NUM_ARP_QUEUE 8 diff --git a/Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c b/Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c index a4c0e6a..3f9175b 100644 --- a/Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c +++ b/Middleware/NXP/hostLib/a71ch/ex/ex_ecc_nohc.c @@ -203,7 +203,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { eccPrivKeyTlsNist256_1, (U16)sizeof(eccPrivKeyTlsNist256_1)); result &= AX_CHECK_SW(err, SW_OK, "err"); - // Check whether public key (of keypair) was written succesfully. + // Check whether public key (of keypair) was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_KEY_PAIR_0; @@ -235,7 +235,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { err = A71_SetEccPublicKey(keyIdx, eccPubKeyCANist256_1, (U16)sizeof(eccPubKeyCANist256_1)); result &= AX_CHECK_SW(err, SW_OK, "err"); - // Check whether public key at index 1 was written succesfully. + // Check whether public key at index 1 was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_PUBLIC_KEY_1; @@ -246,7 +246,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { result &= AX_COMPARE_BYTE_ARRAY("pubEccKeyScratch", pubEccKeyScratch, pubEccKeyScratchLen, "eccPubKeyCANist256_1", eccPubKeyCANist256_1, sizeof(eccPubKeyCANist256_1), AX_COLON_32); - // Check whether public key at index 0 was written succesfully. + // Check whether public key at index 0 was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_PUBLIC_KEY_0; diff --git a/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_cert.c b/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_cert.c index 8b61a01..5285b82 100644 --- a/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_cert.c +++ b/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_cert.c @@ -741,7 +741,7 @@ static U8 exMixedCertsAndDataObj(U8 initMode, U16 nBaseSize, U16 nObj) result &= localScore; } - // Update remaining objects with the alternate reference data, and verify updated data succesfull + // Update remaining objects with the alternate reference data, and verify updated data successfull PRINTF("\r\nNow update remaining certificates and data objects...\r\n"); for (i = 0; i < nObjCreated; i++) { diff --git a/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_ecc_nohc.c b/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_ecc_nohc.c index ed142c9..76dd18a 100644 --- a/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_ecc_nohc.c +++ b/Middleware/NXP/hostLib/a71ch/ex_hlse/ex_hlse_ecc_nohc.c @@ -237,7 +237,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { #endif result &= AX_CHECK_SW(err, SW_OK, "err"); - // Check whether public key (of keypair) was written succesfully. + // Check whether public key (of keypair) was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_KEY_PAIR_0; @@ -285,7 +285,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { #endif result &= AX_CHECK_SW(err, SW_OK, "err"); - // Check whether public key at index 1 was written succesfully. + // Check whether public key at index 1 was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_PUBLIC_KEY_1; @@ -301,7 +301,7 @@ static U8 exEccNoHostCrypto(U8 initMode) { result &= AX_COMPARE_BYTE_ARRAY("pubEccKeyScratch", pubEccKeyScratch, pubEccKeyScratchLen, "eccPubKeyCANist256_1", eccPubKeyCANist256_1, sizeof(eccPubKeyCANist256_1), AX_COLON_32); - // Check whether public key at index 0 was written succesfully. + // Check whether public key at index 0 was written successfully. pubEccKeyScratchLen = sizeof(pubEccKeyScratch); expectedPubKeyLen = 65; keyIdx = A71CH_PUBLIC_KEY_0; diff --git a/Middleware/NXP/hostLib/a71ch/src/a71ch_crypto_ecc.c b/Middleware/NXP/hostLib/a71ch/src/a71ch_crypto_ecc.c index f8bd0af..5fe1cff 100644 --- a/Middleware/NXP/hostLib/a71ch/src/a71ch_crypto_ecc.c +++ b/Middleware/NXP/hostLib/a71ch/src/a71ch_crypto_ecc.c @@ -268,7 +268,7 @@ static U16 A71_EccSign_Local(SST_Index_t index, const U8 *pHash, U16 hashLen, U8 * @param[in] index Storage index of the keypair (private key) to be used. * @param[in] updateBytes Byte array to be written into GP storage * @param[in] updateBytesLen Length of the provided byte array (\p updateBytes). -* @param[out] invocationCount Amount of times the underlying APDU has been called succesfully. +* @param[out] invocationCount Amount of times the underlying APDU has been called successfully. * @retval ::SW_OK Upon successful execution */ U16 A71_EccRestrictedSign(SST_Index_t index, const U8 *updateBytes, U16 updateBytesLen, U8 *invocationCount) diff --git a/Middleware/NXP/hostLib/libCommon/smCom/sci2c.c b/Middleware/NXP/hostLib/libCommon/smCom/sci2c.c index 50a7a29..0c6309b 100644 --- a/Middleware/NXP/hostLib/libCommon/smCom/sci2c.c +++ b/Middleware/NXP/hostLib/libCommon/smCom/sci2c.c @@ -483,7 +483,7 @@ static U16 sci2c_MasterToSlaveDataTx(void* conn_ctx, tSCI2C_Data_t * pSCI2C) i2cErr = sci2c_WriteBlock(conn_ctx, pSci2cData); - // i2c_Okay, /* the command has been transmitted succesfully */ + // i2c_Okay, /* the command has been transmitted successfully */ // i2c_NoAddrAck, /* the slave does not acknowledge the address byte */ // i2c_Failed, diff --git a/Middleware/NXP/hostLib/libCommon/smCom/sci2c.h b/Middleware/NXP/hostLib/libCommon/smCom/sci2c.h index 1b3704b..4fa8d6f 100644 --- a/Middleware/NXP/hostLib/libCommon/smCom/sci2c.h +++ b/Middleware/NXP/hostLib/libCommon/smCom/sci2c.h @@ -55,9 +55,9 @@ /* i2c_status_t indicates the result of the I2C command transmission */ typedef enum { - i2c_Okay, /* the command has been transmitted succesfully */ + i2c_Okay, /* the command has been transmitted successfully */ i2c_NoAddrAck, /* the slave does not acknowledge the address byte */ - i2c_Failed, /* an error or timeout occured, the command has not succesfully been transmitted */ + i2c_Failed, /* an error or timeout occured, the command has not successfully been transmitted */ i2c_Sci2cException /* PCB indicates protocol exception */ } i2c_status_t; diff --git a/Middleware/NXP/hostLib/tstUtil/tstHostCrypto.c b/Middleware/NXP/hostLib/tstUtil/tstHostCrypto.c index cc8f094..da34297 100644 --- a/Middleware/NXP/hostLib/tstUtil/tstHostCrypto.c +++ b/Middleware/NXP/hostLib/tstUtil/tstHostCrypto.c @@ -1731,7 +1731,7 @@ U16 HOSTCRYPTO_GenerateEccKeyByName(int curveName, EC_KEY** ppKey) /** * Generates a key pair for NIST P-256 curve and returns the private and public key as byte arrays. - * @return HOST_CRYPTO_OK when generation was succesful, HOST_CRYPTO_ERROR when generation failed. + * @return HOST_CRYPTO_OK when generation was successful, HOST_CRYPTO_ERROR when generation failed. */ int HOST_ECC_GenerateKeyPair(U8 * pPublicKey, U16 * pPublicKeyLength, U8 * pPrivateKey, U16 * pPrivateKeyLength) { diff --git a/Middleware/NXP/hostLib/tstUtil/tst_sm_util.h b/Middleware/NXP/hostLib/tstUtil/tst_sm_util.h index 80664b1..c84f559 100644 --- a/Middleware/NXP/hostLib/tstUtil/tst_sm_util.h +++ b/Middleware/NXP/hostLib/tstUtil/tst_sm_util.h @@ -29,7 +29,7 @@ extern "C" { #endif -#define AX_UTIL_OK 0 //!< Integer return status value to indicate succesfull execution +#define AX_UTIL_OK 0 //!< Integer return status value to indicate successfull execution #define AX_UTIL_ERROR 1 //!< Integer return status value to indicate execution failure /// @cond diff --git a/Middleware/NXP/sss/src/se05x/fsl_sss_se05x_apis.c b/Middleware/NXP/sss/src/se05x/fsl_sss_se05x_apis.c index df3d44e..1bb134b 100644 --- a/Middleware/NXP/sss/src/se05x/fsl_sss_se05x_apis.c +++ b/Middleware/NXP/sss/src/se05x/fsl_sss_se05x_apis.c @@ -2538,7 +2538,7 @@ static sss_status_t sss_se05x_key_store_set_ecc_key(sss_se05x_key_store_t *keySt switch (keyObject->curve_id) { #if SSS_HAVE_TPM_BN case kSE05x_ECCurve_TPM_ECC_BN_P256: { - LOG_I("Key pair should be paased without header"); + LOG_I("Key pair should be passed without header"); /* No header included in ED and BN curve keys */ privateKeyIndex = 0; publicKeyIndex = 32; @@ -2671,7 +2671,7 @@ static sss_status_t sss_se05x_key_store_set_ecc_key(sss_se05x_key_store_t *keySt switch (keyObject->curve_id) { #if SSS_HAVE_TPM_BN case kSE05x_ECCurve_TPM_ECC_BN_P256: { - LOG_I("Public key should be paased without header"); + LOG_I("Public key should be passed without header"); publicKeyLen = keyLen; } break; #endif diff --git a/cspell.config.yaml b/cspell.config.yaml index 911ce1d..1dc5aac 100644 --- a/cspell.config.yaml +++ b/cspell.config.yaml @@ -29,3 +29,5 @@ ignorePaths: - 'docs' - 'ThirdParty' - 'History.txt' + - 'NXP' + - 'evkbmimxrt1060' diff --git a/examples/common/mqtt_agent/mqtt_agent_task.h b/examples/common/mqtt_agent/mqtt_agent_task.h index 0530388..93e3833 100644 --- a/examples/common/mqtt_agent/mqtt_agent_task.h +++ b/examples/common/mqtt_agent/mqtt_agent_task.h @@ -104,8 +104,8 @@ BaseType_t xWaitForMQTTAgentState( MQTTAgentState_t xStateToWait, * * @param pcTopicFilter Topic filter string for which the publish callback needs to be invoked. * @param usTopicFilterLength Length of the topic filter string. - * @param pxPublishCallback Callback to be invoked whan a publish is received on topic filter. - * @param pvCallbackContext Context to be paased in transparently to the user. + * @param pxPublishCallback Callback to be invoked when a publish is received on topic filter. + * @param pvCallbackContext Context to be passed in transparently to the user. * @param xManageResubscription Whether its a managed subscription. Managed subscriptions are resubscribed by * MQTT agent if the connection is lost and then reconnected. * @return pdTRUE if the callback was added successfully. pdFALSE otherwise. diff --git a/examples/evkbmimxrt1060/defender/include/lwipopts.h b/examples/evkbmimxrt1060/defender/include/lwipopts.h index 3e69a70..553e7cf 100644 --- a/examples/evkbmimxrt1060/defender/include/lwipopts.h +++ b/examples/evkbmimxrt1060/defender/include/lwipopts.h @@ -100,7 +100,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_UDP_PCB 6 #endif -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP +/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP * connections. */ #ifndef MEMP_NUM_TCP_PCB #define MEMP_NUM_TCP_PCB 10 @@ -118,7 +118,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_TCP_SEG 22 #endif -/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active +/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active * timeouts. */ #ifndef MEMP_NUM_SYS_TIMEOUT #define MEMP_NUM_SYS_TIMEOUT 10 diff --git a/examples/evkbmimxrt1060/pubsub/include/lwipopts.h b/examples/evkbmimxrt1060/pubsub/include/lwipopts.h index 0fcc4a5..35cb8e9 100644 --- a/examples/evkbmimxrt1060/pubsub/include/lwipopts.h +++ b/examples/evkbmimxrt1060/pubsub/include/lwipopts.h @@ -101,7 +101,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_UDP_PCB 6 #endif -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP +/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP * connections. */ #ifndef MEMP_NUM_TCP_PCB #define MEMP_NUM_TCP_PCB 10 @@ -119,7 +119,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_TCP_SEG 22 #endif -/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active +/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active * timeouts. */ #ifndef MEMP_NUM_SYS_TIMEOUT #define MEMP_NUM_SYS_TIMEOUT 10 diff --git a/examples/evkbmimxrt1060/shadow/include/lwipopts.h b/examples/evkbmimxrt1060/shadow/include/lwipopts.h index 0fcc4a5..35cb8e9 100644 --- a/examples/evkbmimxrt1060/shadow/include/lwipopts.h +++ b/examples/evkbmimxrt1060/shadow/include/lwipopts.h @@ -101,7 +101,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_UDP_PCB 6 #endif -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP +/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP * connections. */ #ifndef MEMP_NUM_TCP_PCB #define MEMP_NUM_TCP_PCB 10 @@ -119,7 +119,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_TCP_SEG 22 #endif -/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active +/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active * timeouts. */ #ifndef MEMP_NUM_SYS_TIMEOUT #define MEMP_NUM_SYS_TIMEOUT 10 diff --git a/examples/evkbmimxrt1060/test/include/lwipopts.h b/examples/evkbmimxrt1060/test/include/lwipopts.h index 0fcc4a5..35cb8e9 100644 --- a/examples/evkbmimxrt1060/test/include/lwipopts.h +++ b/examples/evkbmimxrt1060/test/include/lwipopts.h @@ -101,7 +101,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_UDP_PCB 6 #endif -/* MEMP_NUM_TCP_PCB: the number of simulatenously active TCP +/* MEMP_NUM_TCP_PCB: the number of simultaneously active TCP * connections. */ #ifndef MEMP_NUM_TCP_PCB #define MEMP_NUM_TCP_PCB 10 @@ -119,7 +119,7 @@ void sys_mark_tcpip_thread( void ); #define MEMP_NUM_TCP_SEG 22 #endif -/* MEMP_NUM_SYS_TIMEOUT: the number of simulateously active +/* MEMP_NUM_SYS_TIMEOUT: the number of simultaneously active * timeouts. */ #ifndef MEMP_NUM_SYS_TIMEOUT #define MEMP_NUM_SYS_TIMEOUT 10