Skip to content
Snippets Groups Projects
Select Git revision
  • 57cb28e8150e707fe24d1b6e177c71e04bc83912
  • v2018.2.x default
  • experimental
  • master
  • v2021.1.2-ffs
  • v2021.1.1-ffs
  • nrb/gluon-master-cpe510
  • v2021.1-ffs
  • v2020.2.3-ffs
  • nrbffs/fastd-remove-delay
  • v2020.2.2-ffs
  • v2020.2.1-ffs
  • v2020.2-ffs
  • v2020.2.x
  • v2020.1.3-ffs
  • v2020.1.1-ffs
  • v2020.1-ffs
  • v2019.1.2-ffs
  • v2019.1.1-ffs
  • nrb/test-radv-filter
  • v2019.1-ffs
  • nrbffs/netgear-ex6120
  • v2021.1.2-ffs0.2
  • v2021.1.2-ffs0.1
  • v2021.1.1-ffs0.4
  • v2021.1.1-ffs0.3
  • v2021.1.1-ffs0.2
  • v2021.1.1-ffs0.1
  • v2021.1-ffs0.1
  • v2020.2.3-ffs0.3
  • v2020.2.3-ffs0.2
  • v2020.2.3-ffs0.1
  • v2020.2.2-ffs0.1
  • v2020.2.1-ffs0.1
  • v2020.2-ffs0.1
  • v2020.2
  • v2020.2.x-ffs0.1
  • v2020.1.3-ffs0.1
  • v2020.1.1-ffs0.1
  • v2020.1-ffs0.1
  • v2019.1.2-ffs0.1
  • v2019.1.1-ffs0.1
42 results

modules

Blame
  • Forked from firmware / FFS Gluon
    Source project has a limited visibility.
    sigtest.sh 820 B
    #!/bin/sh
    
    if [ $# -eq 0 ] || [ "-h" = "$1" ] || [ "-help" = "$1" ] || [ "--help" = "$1" ]; then
    	cat <<EOHELP
    Usage: $0 <public> <signed manifest>
    
    sigtest.sh checks if a manifest is signed by the public key <public>. There is
    no output, success or failure is indicated via the return code.
    
    See also:
     * ecdsautils in https://github.com/freifunk-gluon/ecdsautils
     * https://gluon.readthedocs.io/en/latest/features/autoupdater.html
    
    EOHELP
    	exit 1
    fi
    
    public="$1"
    manifest="$2"
    upper="$(mktemp)"
    lower="$(mktemp)"
    ret=1
    
    awk 'BEGIN    {
    	sep = 0
    }
    
    /^---$/ {
    	sep = 1;
    	next
    }
    
    {
    	if(sep == 0) {
    		print > "'"$upper"'"
    	} else {
    		print > "'"$lower"'"
    	}
    }' "$manifest"
    
    while read -r line
    do
    	if ecdsaverify -s "$line" -p "$public" "$upper"; then
    		ret=0
    		break
    	fi
    done < "$lower"
    
    rm -f "$upper" "$lower"
    exit $ret