devserver: Deprecate autoupdate.py in lieu of nebraska.py

We need to use nebraska everywhere. Currently devserver has its own
buildin library for responding to update_engine XML requests. But now,
nebraska has everything we need and we can switch to nebraska instead of
the buildin library. This CL does that.

This CL also effectively removes the dependency to update_payload
package since we have properties file for each payload now and nebraska
works out of those properties files. Hence we don't need update_payload
library to extract information out of payloads.

BUG=chromium:872441
TEST=unittest
TEST=ran './devserver.py --host_log' in chroot, then:

request.xml: <?xml version="1.0" encoding="UTF-8"?>
<request protocol="3.0" updater="ChromeOSUpdateEngine" updaterversion="0.1.0.0" installsource="ondemandupdate" ismachine="1">
    <os version="Indy" platform="Chrome OS" sp="11960.0.2019_03_22_1211_x86_64"></os>
    <app appid="{8396029B-FCEF-9EEC-C684-3BCB8E3E9429}" version="11960.0.2019_03_22_1211" track="stable-channel" lang="en-US" board="reef" hardware_class="REEF F2B-B4B-22K-N3S-K8L-A2V DEV" delta_okay="true" fw_version="" ec_version="" installdate="4459" >
        <ping active="1" a="1" r="1"></ping>
        <updatecheck></updatecheck>
        <event eventtype="54" eventresult="1" previousversion="11960.0.2019_03_22_1211"></event>
    </app>
</request>

$ curl -d @request.xml 127.0.0.1:8080/update # returned correct response
n
Then:
$ curl 127.0.0.1:8080/api/hostlog?ip=127.0.0.1
Returned the correct hostlog:
[{"track": "stable-channel", "timestamp": "2019-09-19 12:05:52", "version": "11960.0.2019_03_22_1211", "board": "reef"}]

Change-Id: I07a835bbd5936cf84337644097fde2dfce086f0c
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/1640975
Commit-Queue: Amin Hassani <ahassani@chromium.org>
Tested-by: Amin Hassani <ahassani@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
diff --git a/common_util.py b/common_util.py
index a1494a0..6b5e15b 100644
--- a/common_util.py
+++ b/common_util.py
@@ -8,7 +8,6 @@
 from __future__ import print_function
 
 import ast
-import base64
 import binascii
 import distutils.version  # pylint: disable=no-name-in-module,import-error
 import errno
@@ -226,20 +225,14 @@
   return '\n'.join(control_files)
 
 
-def GetFileSize(file_path):
-  """Returns the size in bytes of the file given."""
-  return os.path.getsize(file_path)
-
-
 # Hashlib is strange and doesn't actually define these in a sane way that
 # pylint can find them. Disable checks for them.
 # pylint: disable=E1101,W0106
-def GetFileHashes(file_path, do_sha1=False, do_sha256=False, do_md5=False):
+def GetFileHashes(file_path, do_sha256=False, do_md5=False):
   """Computes and returns a list of requested hashes.
 
   Args:
     file_path: path to file to be hashed
-    do_sha1: whether or not to compute a SHA1 hash
     do_sha256: whether or not to compute a SHA256 hash
     do_md5: whether or not to compute a MD5 hash
 
@@ -248,9 +241,8 @@
     'md5', respectively.
   """
   hashes = {}
-  if any((do_sha1, do_sha256, do_md5)):
+  if any((do_sha256, do_md5)):
     # Initialize hashers.
-    hasher_sha1 = hashlib.sha1() if do_sha1 else None
     hasher_sha256 = hashlib.sha256() if do_sha256 else None
     hasher_md5 = hashlib.md5() if do_md5 else None
 
@@ -260,13 +252,10 @@
         block = fd.read(_HASH_BLOCK_SIZE)
         if not block:
           break
-        hasher_sha1 and hasher_sha1.update(block)
         hasher_sha256 and hasher_sha256.update(block)
         hasher_md5 and hasher_md5.update(block)
 
     # Update return values.
-    if hasher_sha1:
-      hashes['sha1'] = hasher_sha1.digest()
     if hasher_sha256:
       hashes['sha256'] = hasher_sha256.digest()
     if hasher_md5:
@@ -275,16 +264,6 @@
   return hashes
 
 
-def GetFileSha1(file_path):
-  """Returns the SHA1 checksum of the file given (base64 encoded)."""
-  return base64.b64encode(GetFileHashes(file_path, do_sha1=True)['sha1'])
-
-
-def GetFileSha256(file_path):
-  """Returns the SHA256 checksum of the file given (base64 encoded)."""
-  return base64.b64encode(GetFileHashes(file_path, do_sha256=True)['sha256'])
-
-
 def GetFileMd5(file_path):
   """Returns the MD5 checksum of the file given (hex encoded)."""
   return binascii.hexlify(GetFileHashes(file_path, do_md5=True)['md5'])