util/command.rb
# Signature format: Revision NUMBER ONLY (i.e., 12, not 12-asfdgfhdasdjfhnf), immediately followed by script.
# The number is for the revision the new script will be.
# This is to prevent rollback attacks (by an attacker pushing an old script to stop a new script running).
Signature format: Revision NUMBER ONLY , immediately followed by script.
The number is for the revision the new script will be.
This is to prevent rollback attacks (by an attacker pushing an old script to stop a new script running).
Signature format : Revision NUMBER ONLY immediately followed by script . The number is for the revision the new script will be . This is to prevent rollback attacks ( by an attacker pushing an old script to stop a new script running ) .
def signstuff(revision, data, pkeypath)
  pkey = OpenSSL::PKey::EC.new File.read pkeypath
  revm = revision.match(/([0-9]+)-.+/)
  oldrev = revm[1]
  newrev = oldrev.to_i + 1
  signature = Base64.encode64(pkey.dsa_sign_asn1(newrev.to_s+data))
end
def signstuff ( revision , data , pkeypath ) pkey = OpenSSL :: PKey :: EC . new File . read pkeypath revm = revision . match ( / ([0-9]+)-.+ / ) oldrev = revm [ 1 ] newrev = oldrev . to_i + 1 signature = Base64 . encode64 ( pkey . dsa_sign_asn1 ( newrev . to_s + data ) ) end
Signature format: Revision NUMBER ONLY (i.e., 12, not 12-asfdgfhdasdjfhnf), immediately followed by script.
Signature format : Revision NUMBER ONLY ( i . e . 12 not 12 - asfdgfhdasdjfhnf ) immediately followed by script .
revision
<not_specific>
data
<not_specific>
pkeypath
<not_specific>