Skip to content
Snippets Groups Projects
Select Git revision
  • 7b95d1263c2194c6f00fc93ffbc9f282dad6cb20
  • v3.3 default protected
  • experimental protected
  • nrb/airmax-test
  • nrb/ro-flash-nanostation-airmax
  • nrb/add-node-whisperer
  • v3.2 protected
  • v3.1 protected
  • nrb-domains
  • v3.0 protected
  • nrb/dns-cache
  • v2.9 protected
  • feature/addMikrotikwAP
  • v2.8 protected
  • v2.5.1 protected
  • v2.7 protected
  • v2.6 protected
  • v2.5 protected
  • v2.4 protected
  • cpe510
  • nrb/gluon-master-cpe510
  • v3.2.1+2024-12-15
  • v3.2+2024-12-04
  • v3.1+2024-07-08
  • v2.9+2023-05-13
  • v2.9+2023-05-12
  • v2.9+2023-05-10
  • v2.8+2023-03-05
  • v2.7+2022-12-03
  • v2.6+2022-09-06
  • v2.5+2022-05-07
  • v2.5+2022-05-05
  • v2.4+2022-02-26
  • v2.3+2021-06-03
  • v2.3+2021-04-30
  • v2.2+2021-04-16
  • v2.2+2020-04-16
  • v2.1+2020-12-11
  • v2.1+2020-11-17
  • v2.0+2020-09-26
  • v2.0+2020-06-28
41 results

modules

Blame
  • 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