Skip to content

Commit

Permalink
Merge pull request #86 from cryptosphere/require-libsodium-0-4-5
Browse files Browse the repository at this point in the history
Require libsodium 0.4.5 at a minimum
  • Loading branch information
tarcieri committed Oct 24, 2013
2 parents b0422e8 + a721287 commit cd068b2
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
6 changes: 6 additions & 0 deletions lib/rbnacl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@
require "rbnacl/init"

module RbNaCl
REQUIRED_LIBSODIUM_VERSION = "0.4.5"

if Util.sodium_version_string < REQUIRED_LIBSODIUM_VERSION
raise "Sorry, you need to install libsodium #{REQUIRED_LIBSODIUM_VERSION}+. You have #{Util.sodium_version_string} installed"
end

# Oh no, something went wrong!
#
# This indicates a failure in the operation of a cryptographic primitive such
Expand Down
4 changes: 2 additions & 2 deletions lib/rbnacl/rake_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
require 'rake/clean'
require 'digest/sha2'

LIBSODIUM_VERSION = "0.4.4"
LIBSODIUM_DIGEST = "3acb9ed90beecccf2de32c066b9c131a6214f7cd0c6f64cd6759c0ef098d653e"
LIBSODIUM_VERSION = "0.4.5"
LIBSODIUM_DIGEST = "7ad5202df53eeac0eb29b064ae5d05b65d82b2fc1c082899c9c6a09b0ee1ac32"

def sh_hidden(command)
STDERR.puts("*** Executing: #{command}")
Expand Down
2 changes: 2 additions & 0 deletions lib/rbnacl/util.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module RbNaCl
module Util
extend Sodium

attach_function :sodium_version_string, [], :string

sodium_function :c_verify16, :crypto_verify_16, [:pointer, :pointer]
sodium_function :c_verify32, :crypto_verify_32, [:pointer, :pointer]
module_function
Expand Down

0 comments on commit cd068b2

Please sign in to comment.