sockit 1.0.5 → 1.0.6
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.
- checksums.yaml +4 -4
- data/lib/sockit/v5/authentication.rb +4 -4
- data/lib/sockit/v5/support.rb +23 -13
- data/lib/sockit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1c3573605d7f098845826d1e1be93105351ba8c
|
4
|
+
data.tar.gz: a4dfbbe50dc3458b2f82144fae7163fba1b2073e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dd52aeffe4d0e8f19050faab68669bb8b7c0309164fe207b984542e21432206b4726f5030f449d52dd13900010a886d0e6dd32bbac76fbfb5cb39469416e796d
|
7
|
+
data.tar.gz: f198b98c10ff53ca6c7889f46165af6eb50d428e05a1a432d0d141b01854cbace19beb0bd091d44e78d1aa3446f5a543562b0545a6eb2009cc7fc7d6c8fa3130
|
@@ -48,9 +48,9 @@ module Sockit
|
|
48
48
|
end
|
49
49
|
|
50
50
|
if server_auth_method == 0xFF
|
51
|
-
raise SockitError,
|
51
|
+
raise SockitError, build_v5_authentication_method_message(server_auth_method)
|
52
52
|
else
|
53
|
-
log(:green,
|
53
|
+
log(:green, build_v5_authentication_method_message(server_auth_method))
|
54
54
|
end
|
55
55
|
|
56
56
|
# The subsequent authentication is method-dependent. Username and password authentication (method 0x02) is described in RFC 1929:
|
@@ -91,9 +91,9 @@ module Sockit
|
|
91
91
|
status_code = auth_reply[1]
|
92
92
|
|
93
93
|
if status_code == 0x00
|
94
|
-
log(:green,
|
94
|
+
log(:green, build_v5_authentication_status_message(status_code))
|
95
95
|
else
|
96
|
-
raise SockitError,
|
96
|
+
raise SockitError, build_v5_authentication_status_message(status_code)
|
97
97
|
end
|
98
98
|
end
|
99
99
|
|
data/lib/sockit/v5/support.rb
CHANGED
@@ -47,34 +47,44 @@ module Sockit
|
|
47
47
|
# 0x02: Username/Password[11]
|
48
48
|
# 0x03-0x7F: methods assigned by IANA[12]
|
49
49
|
# 0x80-0xFE: methods reserved for private use
|
50
|
-
def
|
51
|
-
case auth_method
|
50
|
+
def build_v5_authentication_method_message(auth_method)
|
51
|
+
message = case auth_method
|
52
52
|
when 0x00 then
|
53
|
-
"No authentication
|
53
|
+
"No authentication"
|
54
54
|
when 0x01 then
|
55
|
-
"GSSAPI authentication
|
55
|
+
"GSSAPI authentication"
|
56
56
|
when 0x02 then
|
57
|
-
"Username/Password authentication
|
57
|
+
"Username/Password authentication"
|
58
58
|
when 0x03..0x7F then
|
59
|
-
"Authentication method assigned by IANA
|
59
|
+
"Authentication method assigned by IANA"
|
60
60
|
when 0x80..0xFE then
|
61
|
-
"Authentication method reserved for private use
|
61
|
+
"Authentication method reserved for private use"
|
62
62
|
when 0xFF then
|
63
|
-
"Unsupported authentication
|
63
|
+
"Unsupported authentication"
|
64
64
|
else
|
65
|
-
"Unknown authentication
|
65
|
+
"Unknown authentication"
|
66
66
|
end
|
67
|
+
|
68
|
+
"%s (Method: 0x%02X)" % [message, auth_method]
|
69
|
+
|
70
|
+
rescue
|
71
|
+
"Authentication Method: #{auth_method.inspect}"
|
67
72
|
end
|
68
73
|
|
69
74
|
# 0x00 = success
|
70
75
|
# any other value = failure, connection must be closed
|
71
|
-
def
|
72
|
-
case auth_status
|
76
|
+
def build_v5_authentication_status_message(auth_status)
|
77
|
+
message = case auth_status
|
73
78
|
when 0x00 then
|
74
|
-
"Authentication success
|
79
|
+
"Authentication success"
|
75
80
|
else
|
76
|
-
"Authentication failure
|
81
|
+
"Authentication failure"
|
77
82
|
end
|
83
|
+
|
84
|
+
"%s (Status: 0x%02X)" % [message, auth_status]
|
85
|
+
|
86
|
+
rescue
|
87
|
+
"Authentication Status: #{auth_status.inspect}"
|
78
88
|
end
|
79
89
|
|
80
90
|
end
|
data/lib/sockit/version.rb
CHANGED