From f3a96298957662acf51d1cb8f43b2a0d5389ee50 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 1 Dec 2023 15:25:09 +0100 Subject: [PATCH] style --- client/src/cmdlf.c | 4 ++-- covsubmit.sh | 33 ++++++++++++++++++++++++++++++++- doc/commands.json | 22 +++++++++------------- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/client/src/cmdlf.c b/client/src/cmdlf.c index 29eadeb85..c9f693573 100644 --- a/client/src/cmdlf.c +++ b/client/src/cmdlf.c @@ -793,7 +793,7 @@ int CmdLFRead(const char *Cmd) { bool cm = arg_get_lit(ctx, 3); CLIParserFree(ctx); - // the 40000 there should be the result of BigBuf_max_traceLen(), + // the 40000 there should be the result of BigBuf_max_traceLen(), // but IDK how to get it. bool realtime = samples > 40000; @@ -904,7 +904,7 @@ int CmdLFSniff(const char *Cmd) { bool cm = arg_get_lit(ctx, 3); CLIParserFree(ctx); - // the 40000 there should be the result of BigBuf_max_traceLen(), + // the 40000 there should be the result of BigBuf_max_traceLen(), // but IDK how to get it. bool realtime = samples > 40000; diff --git a/covsubmit.sh b/covsubmit.sh index 61ca853f1..579caf61d 100755 --- a/covsubmit.sh +++ b/covsubmit.sh @@ -5,6 +5,37 @@ set -e pre_submit_hook +echo "Checking upload permissions..." + +if ! up_perm="$(wget https://scan.coverity.com/api/upload_permitted --post-data "token=${COVTOKEN}&project=${COVPROJECT}" -q -O -)"; then + echo "Coverity Scan API access denied: bad token?" + exit 1 +fi + +# Really up_perm is a JSON response with either +# {upload_permitted:true} or {next_upload_permitted_at:} +# We do some hacky string parsing instead of properly parsing it. +case "$up_perm" in + *upload_permitted*true*) + echo "Coverity Scan: upload permitted" + ;; + *next_upload_permitted_at*) + if [ -z "$COVERITY_DRYRUN" ]; then + echo "Coverity Scan: upload quota reached; stopping here" + # Exit success as this isn't a build error. + exit 0 + else + echo "Coverity Scan: upload quota reached, continuing dry run" + fi + ;; + *) + echo "Coverity Scan upload check: unexpected result $up_perm" + exit 1 + ;; +esac + + + ## delete all previous tarballs rm -f proxmark3.all.*.tgz proxmark3.all.*.log @@ -25,7 +56,7 @@ curl --progress-bar --fail \ --form file="@$FILENAME" \ --form version="$VERSION" \ --form description="$DESCNAME" \ - https://scan.coverity.com/builds?project=Proxmark3+RRG+Iceman+repo | tee -a "${LOGFILENAME}" ; test "${PIPESTATUS[0]}" -eq 0 || exit $? + https://scan.coverity.com/builds?project="${COVPROJECT}" | tee -a "${LOGFILENAME}" ; test "${PIPESTATUS[0]}" -eq 0 || exit $? echo "tarball uploaded to Coverity for analyse" post_submit_hook diff --git a/doc/commands.json b/doc/commands.json index 642e40482..99785b3cd 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -9992,21 +9992,19 @@ }, "lf read": { "command": "lf read", - "description": "Sniff low frequency signal. - use `lf config` to set parameters. - use `data plot` to look at it", + "description": "Sniff low frequency signal. - use `lf config` to set parameters. - use `data plot` to look at it. If the number of samples is more than the device memory limit (40000 now), it will try to use the real-time sampling mode.", "notes": [ "lf read -v -s 12000 -> collect 12000 samples", - "lf read -s 3000 -@ -> oscilloscope style", - "lf read -r -> use real-time mode" + "lf read -s 3000 -@ -> oscilloscope style" ], "offline": false, "options": [ "-h, --help This help", "-s, --samples number of samples to collect", "-v, --verbose verbose output", - "-@ continuous reading mode", - "-r, --realtime real-time reading mode" + "-@ continuous reading mode" ], - "usage": "lf read [-hv@r] [-s ]" + "usage": "lf read [-hv@] [-s ]" }, "lf search": { "command": "lf search", @@ -10179,21 +10177,19 @@ }, "lf sniff": { "command": "lf sniff", - "description": "Sniff low frequency signal. You need to configure the LF part on the Proxmark3 device manually. Usually a trigger and skip samples is a good thing to set before doing a low frequency sniff. - use `lf config` to set parameters. - use `data plot` to look at sniff signal. - use `lf search -1` to see if signal can be automatic decoded", + "description": "Sniff low frequency signal. You need to configure the LF part on the Proxmark3 device manually. Usually a trigger and skip samples is a good thing to set before doing a low frequency sniff. - use `lf config` to set parameters. - use `data plot` to look at sniff signal. - use `lf search -1` to see if signal can be automatic decoded. If the number of samples is more than the device memory limit (40000 now), it will try to use the real-time sampling mode.", "notes": [ "lf sniff -v", - "lf sniff -s 3000 -@ -> oscilloscope style", - "lf sniff -r -> use real-time mode" + "lf sniff -s 3000 -@ -> oscilloscope style" ], "offline": false, "options": [ "-h, --help This help", "-s, --samples number of samples to collect", "-v, --verbose verbose output", - "-@ continuous sniffing mode", - "-r, --realtime real-time sniffing mode" + "-@ continuous sniffing mode" ], - "usage": "lf sniff [-hv@r] [-s ]" + "usage": "lf sniff [-hv@] [-s ]" }, "lf t55xx bruteforce": { "command": "lf t55xx bruteforce", @@ -12070,6 +12066,6 @@ "metadata": { "commands_extracted": 699, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2023-12-01T09:58:53" + "extracted_on": "2023-12-01T14:06:40" } } \ No newline at end of file