You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

32 lines
1.1 KiB

  1. #!/bin/sh
  2. set -e
  3. TESTDIR="$(readlink -f "$(dirname "$0")")"
  4. . "$TESTDIR/framework"
  5. setupenvironment
  6. configarchitecture "i386"
  7. buildsimplenativepackage 'foo' 'all' '1' 'stable'
  8. setupaptarchive --no-update
  9. changetohttpswebserver
  10. # User has mirror method configured in apt >= 1.6~alpha6 &
  11. # Eve has enough MITM control over the network to
  12. # a) have the mirror file include at least two mirrors and
  13. # b) can send her bad InRelease files for both mirrors
  14. sed -i -e 's# https:# mirror+https:#' -e 's#/ stable#/mirror.txt stable#' rootdir/etc/apt/sources.list.d/*-stable-*
  15. echo "http://localhost:${APTHTTPPORT}
  16. https://localhost:${APTHTTPSPORT}" > aptarchive/mirror.txt
  17. # real Eve would do something worse…
  18. sed -i "/^Date: / a\
  19. Evil: yes" $(find ./aptarchive -name 'Release' -o -name 'InRelease')
  20. # progress display shows that the InRelease file was bad,
  21. # but it is used anyhow as the bad file causes a fallback to
  22. # a request to the second mirror which completes successful
  23. # causing apt to believe the verify completed successfully…
  24. testfailure apt update
  25. testfailure grep '^Evil:' rootdir/var/lib/apt/lists/*Release
  26. testfailure apt show foo