Advertisement
voodooKobra

Upgrade OpenSSL to 1.0.1g on Ubuntu 13.04

Apr 8th, 2014
2,072
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.19 KB | None | 0 0
  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 --verify openssl-1.0.1g.tar.gz.asc openssl-1.0.1g.tar.gz
  25.  
  26. if [[ $? -eq 0 ]]; then
  27.     tar xzvf openssl-1.0.1g.tar.gz
  28.     cd openssl-1.0.1g && sudo ./config && sudo make && sudo make install
  29.     # To link the old openssl library to a new version
  30.     ln -sf /usr/local/ssl/bin/openssl `which openssl`
  31.     echo
  32.     echo "DONE!"
  33. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement