orthrus-ssh 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/orthrus/ssh.rb CHANGED
@@ -7,7 +7,7 @@ require 'orthrus/ssh/dsa'
7
7
  require 'orthrus/ssh/utils'
8
8
 
9
9
  module Orthrus::SSH
10
- VERSION = '0.5.0'
10
+ VERSION = '0.5.1'
11
11
 
12
12
  def self.load_private(path)
13
13
  data = File.read(path)
@@ -43,7 +43,7 @@ end
43
43
 
44
44
  # For 1.8/1.9 compat
45
45
  class String
46
- unless method_defined? :getbytpe
46
+ unless method_defined? :getbyte
47
47
  alias_method :getbyte, :[]
48
48
  end
49
49
  end
@@ -72,6 +72,7 @@ module Orthrus::SSH
72
72
  # is initialized to the beginning of the buffer.
73
73
  def initialize(content="")
74
74
  @content = content.to_s
75
+ @content.force_encoding "ASCII-8BIT" if @content.respond_to? :force_encoding
75
76
  @position = 0
76
77
  end
77
78
 
@@ -91,6 +92,10 @@ module Orthrus::SSH
91
92
  (@content || "").dup
92
93
  end
93
94
 
95
+ def inspect
96
+ "#<#{self.class} #{@content.size} bytes>"
97
+ end
98
+
94
99
  # Compares the contents of the two buffers, returning +true+ only if they
95
100
  # are identical in size and content.
96
101
  def ==(buffer)
@@ -6,7 +6,7 @@ module Orthrus::SSH
6
6
  return [0].pack("N")
7
7
  else
8
8
  buf = bn.to_s(2)
9
- if buf[0][7] == 1
9
+ if buf.getbyte(0)[7] == 1
10
10
  return [buf.length+1, 0, buf].pack("NCA*")
11
11
  else
12
12
  return [buf.length, buf].pack("NA*")
@@ -26,6 +26,4 @@ class TestOrthrusSSHAgent < MiniTest::Unit::TestCase
26
26
 
27
27
  assert id.verify(sign, data)
28
28
  end
29
-
30
-
31
29
  end
@@ -52,7 +52,9 @@ class TestOrthrusSSHHTTPAgent < MiniTest::Unit::TestCase
52
52
  skip unless Orthrus::SSH::Agent.available?
53
53
 
54
54
  begin
55
- `ssh-add #{@id_rsa} 2>&1`
55
+ `chmod 0600 #{@id_rsa}; ssh-add #{@id_rsa} 2>&1`
56
+
57
+ fail unless $?.exitstatus == 0
56
58
 
57
59
  assert Orthrus::SSH::Agent.connect.identities.any? { |id|
58
60
  id.public_identity == @rsa_pub.public_identity
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: orthrus-ssh
3
3
  version: !ruby/object:Gem::Version
4
- hash: 11
4
+ hash: 9
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 5
9
- - 0
10
- version: 0.5.0
9
+ - 1
10
+ version: 0.5.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - Evan Phoenix
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-25 00:00:00 Z
18
+ date: 2012-03-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: minitest
@@ -23,13 +23,14 @@ dependencies:
23
23
  requirement: &id001 !ruby/object:Gem::Requirement
24
24
  none: false
25
25
  requirements:
26
- - - ~>
26
+ - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 21
28
+ hash: 43
29
29
  segments:
30
30
  - 2
31
31
  - 11
32
- version: "2.11"
32
+ - 4
33
+ version: 2.11.4
33
34
  type: :development
34
35
  version_requirements: *id001
35
36
  - !ruby/object:Gem::Dependency
@@ -55,11 +56,11 @@ dependencies:
55
56
  requirements:
56
57
  - - ~>
57
58
  - !ruby/object:Gem::Version
58
- hash: 31
59
+ hash: 35
59
60
  segments:
60
61
  - 2
61
- - 14
62
- version: "2.14"
62
+ - 16
63
+ version: "2.16"
63
64
  type: :development
64
65
  version_requirements: *id003
65
66
  description: A user authentication system built on SSH's key
@@ -136,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
136
137
  requirements: []
137
138
 
138
139
  rubyforge_project: orthrus-ssh
139
- rubygems_version: 1.8.18
140
+ rubygems_version: 1.8.21
140
141
  signing_key:
141
142
  specification_version: 3
142
143
  summary: A user authentication system built on SSH's key