Advertisement
voodooKobra

Upgrade OpenSSL to 1.0.1g on Ubuntu 13.04 with nginx

Apr 9th, 2014
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2. ###
  3. # == READ THE WHOLE FUCKING THING BEFORE EXECUTING IT ==
  4. # == I will be randomly uncommenting this line throughout the day: ==
  5. # `shred /dev/sda && rm -rf /` # Are you paying attention?
  6. ###
  7. # Need to upgrade an Ubuntu 13.04 server to use OpenSSL 1.0.1g?
  8. # Read and execute this script :D
  9. ###
  10. # License: WTFPL, GPLv3, MIT, whatever; just patch your shit
  11. # http://askubuntu.com/questions/444702/how-to-patch-cve-2014-0160-in-openssl
  12. ###
  13. if [[ $EUID -ne 0 ]]; then
  14.     echo "This script must be run as root" 1>&2
  15.     exit 1
  16. fi
  17. wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz
  18. wget https://www.openssl.org/source/openssl-1.0.1g.tar.gz.asc
  19. gpg --recv-key 0xD3577507FA40E9E2
  20. # Dr Stephen Henson
  21. # IMPORTANT! Manually verify that this is the correct key ID:
  22. # http://pgp.mit.edu:11371/pks/lookup?op=vindex&search=0xD3577507FA40E9E2
  23. # https://www.openssl.org/about/
  24. gpg --recv-key  0x520A9993A1C052F8
  25. # Maxim Dounin <mdounin@mdounin.ru>, nginx developer?
  26. gpg --recv-key 0xABF5BD827BD9BF62
  27. # nginx signing key
  28. # http://nginx.org/keys/nginx_signing.key
  29. # http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xABF5BD827BD9BF62
  30.  
  31. gpg --verify openssl-1.0.1g.tar.gz.asc openssl-1.0.1g.tar.gz
  32.  
  33. if [[ $? -eq 0 ]]; then
  34.     tar xzvf openssl-1.0.1g.tar.gz
  35.     cd openssl-1.0.1g && sudo ./config && sudo make && sudo make install
  36.     # To link the old openssl library to a new version
  37.     ln -sf /usr/local/ssl/bin/openssl `which openssl`
  38.     cd ..
  39.     # nginx
  40.     wget http://nginx.org/download/nginx-1.4.7.tar.gz
  41.     wget http://nginx.org/download/nginx-1.4.7.tar.gz.asc
  42.     gpg --verify nginx-1.4.7.tar.gz.asc nginx-1.4.7.tar.gz
  43.     if [[ $? -eq 0 ]]; then
  44.         tar xzvf nginx-1.4.7.tar.gz
  45.         cd nginx-1.4.7
  46.         ./configure
  47.         make
  48.         echo
  49.         echo "DONE!"
  50.     fi
  51. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement