gssapi 1.1.0 → 1.1.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/VERSION +1 -1
- data/lib/gssapi/exceptions.rb +8 -0
- data/lib/gssapi/lib_gssapi.rb +3 -0
- data/lib/gssapi/simple.rb +22 -2
- metadata +5 -5
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.1
|
data/lib/gssapi/exceptions.rb
CHANGED
@@ -11,6 +11,14 @@ module GSSAPI
|
|
11
11
|
def message; to_s + ": " + @s; end
|
12
12
|
|
13
13
|
def initialize(maj_stat = nil, min_stat = nil)
|
14
|
+
|
15
|
+
# If raised as class (raise GssApiError, "msg) the error message is given
|
16
|
+
# as the first parameter.
|
17
|
+
if maj_stat.class == String
|
18
|
+
@s = maj_stat
|
19
|
+
return super maj_stat
|
20
|
+
end
|
21
|
+
|
14
22
|
if(maj_stat.nil? && min_stat.nil?)
|
15
23
|
@s = '(no error info)'
|
16
24
|
else
|
data/lib/gssapi/lib_gssapi.rb
CHANGED
@@ -257,6 +257,9 @@ module GSSAPI
|
|
257
257
|
# gss_buffer_t output_token, OM_uint32 *ret_flags, OM_uint32 *time_rec, gss_cred_id_t *delegated_cred_handle);
|
258
258
|
attach_function :gss_accept_sec_context, [:pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer, :pointer], :OM_uint32
|
259
259
|
|
260
|
+
# OM_uint32 gss_display_name(OM_uint32 * minor_status, gss_name_t input_name, gss_buffer_t output_name_buffer, gss_OID * output_name_type);
|
261
|
+
attach_function :gss_display_name, [:pointer, :pointer, :pointer, :pointer], :OM_uint32
|
262
|
+
|
260
263
|
# OM_uint32 gss_acquire_cred(OM_uint32 *minor_status, const gss_name_t desired_name, OM_uint32 time_req, const gss_OID_set desired_mechs,
|
261
264
|
# gss_cred_usage_t cred_usage, gss_cred_id_t *output_cred_handle, gss_OID_set *actual_mechs, OM_uint32 *time_rec);
|
262
265
|
attach_function :gss_acquire_cred, [:pointer, :pointer, :OM_uint32, :pointer, :OM_uint32, :pointer, :pointer, :pointer], :OM_uint32
|
data/lib/gssapi/simple.rb
CHANGED
@@ -107,7 +107,7 @@ module GSSAPI
|
|
107
107
|
min_stat = FFI::MemoryPointer.new :OM_uint32
|
108
108
|
ctx = (@context.nil? ? LibGSSAPI::GssCtxIdT.gss_c_no_context.address_of : @context.address_of)
|
109
109
|
no_chn_bind = LibGSSAPI::GSS_C_NO_CHANNEL_BINDINGS
|
110
|
-
client = FFI::MemoryPointer.new :pointer # Will hold the initiating client name after the call
|
110
|
+
@client = FFI::MemoryPointer.new :pointer # Will hold the initiating client name after the call
|
111
111
|
mech = FFI::MemoryPointer.new :pointer # Will hold the mech being used after the call
|
112
112
|
in_tok = GSSAPI::LibGSSAPI::UnManagedGssBufferDesc.new
|
113
113
|
in_tok.value = in_token
|
@@ -119,7 +119,7 @@ module GSSAPI
|
|
119
119
|
@scred,
|
120
120
|
in_tok.pointer,
|
121
121
|
no_chn_bind,
|
122
|
-
client,
|
122
|
+
@client,
|
123
123
|
mech,
|
124
124
|
out_tok.pointer,
|
125
125
|
ret_flags,
|
@@ -131,6 +131,26 @@ module GSSAPI
|
|
131
131
|
out_tok.length > 0 ? out_tok.value : true
|
132
132
|
end
|
133
133
|
|
134
|
+
# Get textual representation of internal GSS name
|
135
|
+
# @return [String] textual representation of internal GSS name
|
136
|
+
def display_name
|
137
|
+
raise GssApiError.new(), "No context accepted yet. Call #{self.class.name}#accept_context(in_token) first" if @client.nil?
|
138
|
+
|
139
|
+
output_name = GSSAPI::LibGSSAPI::ManagedGssBufferDesc.new
|
140
|
+
|
141
|
+
min_stat = FFI::MemoryPointer.new :OM_uint32
|
142
|
+
maj_stat = LibGSSAPI.gss_display_name(min_stat,
|
143
|
+
@client.get_pointer(0),
|
144
|
+
output_name.pointer,
|
145
|
+
nil)
|
146
|
+
|
147
|
+
if maj_stat != GSSAPI::LibGSSAPI::GSS_S_COMPLETE
|
148
|
+
raise GssApiError.new(maj_stat, min_stat),
|
149
|
+
"gss_display_name did not return GSS_S_COMPLETE but #{ maj_stat }"
|
150
|
+
end
|
151
|
+
|
152
|
+
output_name.value
|
153
|
+
end
|
134
154
|
|
135
155
|
# Acquire security credentials. This does not log you in. It grabs the credentials from a cred cache or keytab.
|
136
156
|
# @param [Hash] opts options to pass to the gss_acquire_cred function.
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gssapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ffi
|
16
|
-
requirement: &
|
16
|
+
requirement: &6301300 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,7 +21,7 @@ dependencies:
|
|
21
21
|
version: 1.0.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *6301300
|
25
25
|
description: ! " A FFI wrapper around the system GSSAPI library. Please make sure
|
26
26
|
and read the\n Yard docs or standard GSSAPI documentation if you have any questions.\n
|
27
27
|
\ \n There is also a class called GSSAPI::Simple that wraps many of the common
|
@@ -76,7 +76,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
76
76
|
version: '0'
|
77
77
|
requirements: []
|
78
78
|
rubyforge_project:
|
79
|
-
rubygems_version: 1.8.
|
79
|
+
rubygems_version: 1.8.17
|
80
80
|
signing_key:
|
81
81
|
specification_version: 3
|
82
82
|
summary: A FFI wrapper around the system GSSAPI library.
|