gssapi 1.1.2 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Changelog.md +14 -0
- data/Gemfile +2 -0
- data/README.md +22 -0
- data/Rakefile +10 -28
- data/VERSION +1 -1
- data/gssapi.gemspec +6 -5
- data/lib/gssapi/extensions.rb +40 -0
- data/lib/gssapi/lib_gssapi.rb +4 -31
- data/lib/gssapi/lib_gssapi_loader.rb +11 -8
- data/lib/gssapi/simple.rb +26 -8
- metadata +23 -20
- data/README.textile +0 -16
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 4900e3de24fcb1b4bd1e1f6e4beece74187ac663
|
4
|
+
data.tar.gz: 25cd31e5aacea658b701c8870a9d14ce6bb735bf
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d0bf8e7383f210b60f3b9e8207d8a6fd15caea5712dc247e2e3fc014de1f527349e8e97e1110a47f7512ff62622052db2cce1ff1320274a498b4aea3e4604c4d
|
7
|
+
data.tar.gz: 8ae992ceaab77f81815aa836181cc8b929c93b0b58b129d1a27a7f186739384127ee0fdc47105564ffa13c767a4ee20a8926f143bd5b98710c5a2a24a9666669
|
data/Changelog.md
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
## Version 1.1.1
|
2
|
+
* Allow GssApiError to be initialized with string.
|
3
|
+
* Add display_name wrapper for gss_display_name to GSSAPI::Simple
|
4
|
+
* gss_iov examples
|
5
|
+
* Ruby 1.8.x support
|
6
|
+
* Change loader for MIT and Heimdal to be a bit cleaner. Fix syntax in simple.rb
|
7
|
+
* Do a gss_acquire_cred for every connection to the server.
|
8
|
+
* updating path to gssapi32.dll
|
9
|
+
|
10
|
+
## Version 1.1.2
|
11
|
+
* add gss_get_mic
|
12
|
+
|
13
|
+
## Version 1.2.0
|
14
|
+
* Move IOV and AEAD to gssapi/extensions.rb so it can be loaded separately when needed
|
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# Ruby GSSAPI Library
|
2
|
+
|
3
|
+
This is a wrapper around the system GSSAPI library (MIT only at this time). It exposes the low-level GSSAPI methods like gss_init_sec_context and gss_wrap and also provides an easier to use wrapper on top of this for common usage scenarios.
|
4
|
+
|
5
|
+
|
6
|
+
I'm going to try and maintain most of the docs in the Github WIKI for this project so please check there for documentation and examples.
|
7
|
+
|
8
|
+
https://github.com/zenchild/gssapi/wiki
|
9
|
+
|
10
|
+
|
11
|
+
Also check out the examples directory for some stubbed out client/server examples.
|
12
|
+
|
13
|
+
|
14
|
+
## Note on IOV and AEAD functions
|
15
|
+
|
16
|
+
If you require the IOV and AEAD functions you will have to `require "gssapi/extensions"` to gain access to them.
|
17
|
+
|
18
|
+
|
19
|
+
#### License
|
20
|
+
|
21
|
+
Copyright © 2010 Dan Wanek <dan.wanek@gmail.com>
|
22
|
+
Ruby gssapi is licensed under the MIT license (see COPYING)
|
data/Rakefile
CHANGED
@@ -1,29 +1,11 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
desc "Increment the version by 1 minor release"
|
12
|
-
task :versionup do
|
13
|
-
ver = up_min_version
|
14
|
-
puts "New version: #{ver}"
|
15
|
-
end
|
16
|
-
|
17
|
-
|
18
|
-
def up_min_version
|
19
|
-
f = File.open('VERSION', 'r+')
|
20
|
-
ver = f.readline.chomp
|
21
|
-
v_arr = ver.split(/\./).map do |v|
|
22
|
-
v.to_i
|
23
|
-
end
|
24
|
-
v_arr[2] += 1
|
25
|
-
ver = v_arr.join('.')
|
26
|
-
f.rewind
|
27
|
-
f.write(ver)
|
28
|
-
ver
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
desc "Open a Pry Console"
|
4
|
+
task :console do
|
5
|
+
require "pry"
|
6
|
+
require "pathname"
|
7
|
+
$: << (Pathname(__FILE__).dirname + "lib").to_s
|
8
|
+
require "gssapi"
|
9
|
+
ARGV.clear
|
10
|
+
Pry.start
|
29
11
|
end
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.
|
1
|
+
1.2.0
|
data/gssapi.gemspec
CHANGED
@@ -4,21 +4,22 @@ $:.unshift lib unless $:.include?(lib)
|
|
4
4
|
require 'date'
|
5
5
|
|
6
6
|
Gem::Specification.new do |gem|
|
7
|
-
gem.name
|
8
|
-
gem.version
|
9
|
-
gem.date
|
7
|
+
gem.name = "gssapi"
|
8
|
+
gem.version = File.open('VERSION').readline.chomp
|
9
|
+
gem.date = Date.today.to_s
|
10
10
|
gem.platform = Gem::Platform::RUBY
|
11
11
|
gem.rubyforge_project = nil
|
12
12
|
|
13
13
|
gem.author = "Dan Wanek"
|
14
14
|
gem.email = "dan.wanek@gmail.com"
|
15
15
|
gem.homepage = "http://github.com/zenchild/gssapi"
|
16
|
+
gem.license = "MIT"
|
16
17
|
|
17
18
|
gem.summary = "A FFI wrapper around the system GSSAPI library."
|
18
19
|
gem.description = <<-EOF
|
19
20
|
A FFI wrapper around the system GSSAPI library. Please make sure and read the
|
20
21
|
Yard docs or standard GSSAPI documentation if you have any questions.
|
21
|
-
|
22
|
+
|
22
23
|
There is also a class called GSSAPI::Simple that wraps many of the common features
|
23
24
|
used for GSSAPI.
|
24
25
|
EOF
|
@@ -26,7 +27,7 @@ Gem::Specification.new do |gem|
|
|
26
27
|
gem.files = `git ls-files`.split(/\n/)
|
27
28
|
gem.require_path = "lib"
|
28
29
|
gem.rdoc_options = %w(-x test/ -x examples/)
|
29
|
-
gem.extra_rdoc_files = %w(README.
|
30
|
+
gem.extra_rdoc_files = %w(README.md COPYING Changelog.md)
|
30
31
|
|
31
32
|
gem.required_ruby_version = '>= 1.8.7'
|
32
33
|
gem.add_runtime_dependency 'ffi', '>= 1.0.1'
|
@@ -0,0 +1,40 @@
|
|
1
|
+
=begin
|
2
|
+
Copyright © 2014 Dan Wanek <dan.wanek@gmail.com>
|
3
|
+
|
4
|
+
Licensed under the MIT License: http://www.opensource.org/licenses/mit-license.php
|
5
|
+
=end
|
6
|
+
module GSSAPI
|
7
|
+
module LibGSSAPI
|
8
|
+
|
9
|
+
# Some versions of GSSAPI might not have support for IOV yet.
|
10
|
+
begin
|
11
|
+
# OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap_iov( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
12
|
+
# int conf_req_flag, gss_qop_t qop_req, int * conf_state, gss_iov_buffer_desc * iov, int iov_count );
|
13
|
+
attach_function :gss_wrap_iov, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :int], :OM_uint32
|
14
|
+
|
15
|
+
# OM_uint32 GSSAPI_LIB_FUNCTION gss_unwrap_iov ( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
16
|
+
# int * conf_state, gss_qop_t * qop_state, gss_iov_buffer_desc * iov, int iov_count )
|
17
|
+
attach_function :gss_unwrap_iov, [:pointer, :pointer, :pointer, :pointer, :pointer, :int], :OM_uint32
|
18
|
+
|
19
|
+
# OM_uint32 GSSAPI_LIB_CALL gss_wrap_iov_length ( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
20
|
+
# int conf_req_flag, gss_qop_t qop_req, int * conf_state, gss_iov_buffer_desc * iov, int iov_count)
|
21
|
+
attach_function :gss_wrap_iov_length, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :int], :OM_uint32
|
22
|
+
rescue FFI::NotFoundError => ex
|
23
|
+
warn "WARNING: Could not load IOV methods. Check your GSSAPI C library for an update"
|
24
|
+
end
|
25
|
+
|
26
|
+
begin
|
27
|
+
# OM_uint32 gss_wrap_aead(OM_uint32 * minor_status, gss_ctx_id_t context_handle, int conf_req_flag,
|
28
|
+
# gss_qop_t qop_req, gss_buffer_t input_assoc_buffer,
|
29
|
+
# gss_buffer_t input_payload_buffer, int * conf_state, gss_buffer_t output_message_buffer);
|
30
|
+
attach_function :gss_wrap_aead, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :pointer, :pointer], :OM_uint32
|
31
|
+
|
32
|
+
# OM_uint32 gss_unwrap_aead(OM_uint32 * minor_status, gss_ctx_id_t context_handle, gss_buffer_t input_message_buffer,
|
33
|
+
# gss_buffer_t input_assoc_buffer, gss_buffer_t output_payload_buffer, int * conf_state, gss_qop_t * qop_state);
|
34
|
+
attach_function :gss_unwrap_aead, [:pointer,:pointer,:pointer,:pointer,:pointer,:pointer,:pointer], :OM_uint32
|
35
|
+
rescue FFI::NotFoundError => ex
|
36
|
+
warn "WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update"
|
37
|
+
end
|
38
|
+
|
39
|
+
end
|
40
|
+
end
|
data/lib/gssapi/lib_gssapi.rb
CHANGED
@@ -158,7 +158,7 @@ module GSSAPI
|
|
158
158
|
|
159
159
|
def self.release(ptr)
|
160
160
|
if( ptr.address == 0 )
|
161
|
-
puts "NULL POINTER: Not freeing" if $DEBUG
|
161
|
+
puts "Releasing #{self.name} NULL POINTER: Not freeing" if $DEBUG
|
162
162
|
return
|
163
163
|
else
|
164
164
|
puts "Releasing #{self.name} at #{ptr.address.to_s(16)}" if $DEBUG
|
@@ -270,36 +270,6 @@ module GSSAPI
|
|
270
270
|
# min_stat = FFI::MemoryPointer.new :OM_uint32
|
271
271
|
# Remember to free the allocated output_message_buffer with gss_release_buffer
|
272
272
|
attach_function :gss_wrap, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :pointer], :OM_uint32
|
273
|
-
|
274
|
-
# Some versions of GSSAPI might not have support for IOV yet.
|
275
|
-
begin
|
276
|
-
# OM_uint32 GSSAPI_LIB_FUNCTION gss_wrap_iov( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
277
|
-
# int conf_req_flag, gss_qop_t qop_req, int * conf_state, gss_iov_buffer_desc * iov, int iov_count );
|
278
|
-
attach_function :gss_wrap_iov, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :int], :OM_uint32
|
279
|
-
|
280
|
-
# OM_uint32 GSSAPI_LIB_FUNCTION gss_unwrap_iov ( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
281
|
-
# int * conf_state, gss_qop_t * qop_state, gss_iov_buffer_desc * iov, int iov_count )
|
282
|
-
attach_function :gss_unwrap_iov, [:pointer, :pointer, :pointer, :pointer, :pointer, :int], :OM_uint32
|
283
|
-
|
284
|
-
# OM_uint32 GSSAPI_LIB_CALL gss_wrap_iov_length ( OM_uint32 * minor_status, gss_ctx_id_t context_handle,
|
285
|
-
# int conf_req_flag, gss_qop_t qop_req, int * conf_state, gss_iov_buffer_desc * iov, int iov_count)
|
286
|
-
attach_function :gss_wrap_iov_length, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :int], :OM_uint32
|
287
|
-
rescue FFI::NotFoundError => ex
|
288
|
-
warn "WARNING: Could not load IOV methods. Check your GSSAPI C library for an update"
|
289
|
-
end
|
290
|
-
|
291
|
-
begin
|
292
|
-
# OM_uint32 gss_wrap_aead(OM_uint32 * minor_status, gss_ctx_id_t context_handle, int conf_req_flag,
|
293
|
-
# gss_qop_t qop_req, gss_buffer_t input_assoc_buffer,
|
294
|
-
# gss_buffer_t input_payload_buffer, int * conf_state, gss_buffer_t output_message_buffer);
|
295
|
-
attach_function :gss_wrap_aead, [:pointer, :pointer, :int, :OM_uint32, :pointer, :pointer, :pointer, :pointer], :OM_uint32
|
296
|
-
|
297
|
-
# OM_uint32 gss_unwrap_aead(OM_uint32 * minor_status, gss_ctx_id_t context_handle, gss_buffer_t input_message_buffer,
|
298
|
-
# gss_buffer_t input_assoc_buffer, gss_buffer_t output_payload_buffer, int * conf_state, gss_qop_t * qop_state);
|
299
|
-
attach_function :gss_unwrap_aead, [:pointer,:pointer,:pointer,:pointer,:pointer,:pointer,:pointer], :OM_uint32
|
300
|
-
rescue FFI::NotFoundError => ex
|
301
|
-
warn "WARNING: Could not load AEAD methods. Check your GSSAPI C library for an update"
|
302
|
-
end
|
303
273
|
|
304
274
|
# OM_uint32 gss_unwrap(OM_uint32 * minor_status, const gss_ctx_id_t context_handle,
|
305
275
|
# const gss_buffer_t input_message_buffer, gss_buffer_t output_message_buffer, int * conf_state, gss_qop_t * qop_state);
|
@@ -330,6 +300,9 @@ module GSSAPI
|
|
330
300
|
# OM_uint32 gss_display_status(OM_uint32 *minor_status, OM_uint32 status_value, int status_type, gss_OID mech_type, OM_uint32 *message_context, gss_buffer_t status_string)
|
331
301
|
attach_function :gss_display_status, [:pointer, :OM_uint32, :int, :pointer, :pointer, :pointer], :OM_uint32
|
332
302
|
|
303
|
+
# OM_uint32 gss_krb5_copy_ccache(OM_uint32 *minor_status, gss_cred_id_t cred_handle, krb5_ccache out_ccache)
|
304
|
+
attach_function :gss_krb5_copy_ccache, [:pointer, :pointer, :pointer], :OM_uint32
|
305
|
+
|
333
306
|
# Variable definitions
|
334
307
|
# --------------------
|
335
308
|
|
@@ -17,22 +17,24 @@ module GSSAPI
|
|
17
17
|
|
18
18
|
|
19
19
|
def self.load_mit
|
20
|
-
|
20
|
+
host_os = RbConfig::CONFIG['host_os']
|
21
|
+
case host_os
|
21
22
|
when /linux/
|
22
23
|
gssapi_lib = 'libgssapi_krb5.so.2'
|
24
|
+
ffi_lib gssapi_lib, FFI::Library::LIBC
|
23
25
|
when /darwin/
|
24
26
|
gssapi_lib = '/usr/lib/libgssapi_krb5.dylib'
|
27
|
+
ffi_lib gssapi_lib, FFI::Library::LIBC
|
25
28
|
when /mswin|mingw32|windows/
|
26
29
|
# Pull the gssapi32 path from the environment if it exist, otherwise use the default in Program Files
|
27
30
|
gssapi32_path = ENV['gssapi32'] ? ENV['gssapi32'] : 'C:\Program Files (x86)\MIT\Kerberos\bin\gssapi32.dll'
|
28
31
|
ffi_lib gssapi32_path, FFI::Library::LIBC # Required the MIT Kerberos libraries to be installed
|
29
32
|
ffi_convention :stdcall
|
30
33
|
else
|
31
|
-
raise LoadError, "This
|
34
|
+
raise LoadError, "This host OS (#{host_os}) is not supported by ruby gssapi and the MIT libraries."
|
32
35
|
end
|
33
|
-
ffi_lib gssapi_lib, FFI::Library::LIBC
|
34
36
|
|
35
|
-
# -------------------- MIT Specifics --------------------
|
37
|
+
# -------------------- MIT Specifics --------------------
|
36
38
|
attach_variable :__GSS_C_NT_HOSTBASED_SERVICE, :GSS_C_NT_HOSTBASED_SERVICE, :pointer # type gss_OID
|
37
39
|
attach_variable :__GSS_C_NT_EXPORT_NAME, :GSS_C_NT_EXPORT_NAME, :pointer # type gss_OID
|
38
40
|
LibGSSAPI.const_set("GSS_C_NT_HOSTBASED_SERVICE", __GSS_C_NT_HOSTBASED_SERVICE)
|
@@ -40,25 +42,26 @@ module GSSAPI
|
|
40
42
|
end
|
41
43
|
|
42
44
|
def self.load_heimdal
|
43
|
-
|
45
|
+
host_os = RbConfig::CONFIG['host_os']
|
46
|
+
case host_os
|
44
47
|
when /linux/
|
45
48
|
gssapi_lib = 'libgssapi.so.3'
|
46
49
|
when /darwin/
|
47
50
|
# use Heimdal Kerberos since Mac MIT Kerberos is OLD. Do a "require 'gssapi/heimdal'" first
|
48
51
|
gssapi_lib = '/usr/heimdal/lib/libgssapi.dylib'
|
49
52
|
else
|
50
|
-
raise LoadError, "This
|
53
|
+
raise LoadError, "This host OS (#{host_os}) is not supported by ruby gssapi and the Heimdal libraries."
|
51
54
|
end
|
52
55
|
ffi_lib gssapi_lib, FFI::Library::LIBC
|
53
56
|
|
54
|
-
# ------------------ Heimdal Specifics ------------------
|
57
|
+
# ------------------ Heimdal Specifics ------------------
|
55
58
|
attach_variable :__gss_c_nt_hostbased_service_oid_desc, GssOID
|
56
59
|
attach_variable :__gss_c_nt_export_name_oid_desc, GssOID
|
57
60
|
LibGSSAPI.const_set("GSS_C_NT_HOSTBASED_SERVICE", FFI::Pointer.new(__gss_c_nt_hostbased_service_oid_desc.to_ptr))
|
58
61
|
LibGSSAPI.const_set("GSS_C_NT_EXPORT_NAME", FFI::Pointer.new(__gss_c_nt_export_name_oid_desc.to_ptr))
|
59
62
|
end
|
60
63
|
|
61
|
-
# Heimdal supported the *_iov functions
|
64
|
+
# Heimdal supported the *_iov functions before MIT did so in some OS distributions if
|
62
65
|
# you need IOV support and MIT does not provide it try the Heimdal libs and then
|
63
66
|
# before doing a "require 'gssapi'" do a "require 'gssapi/heimdal'" and that will attempt
|
64
67
|
# to load the Heimdal libs
|
data/lib/gssapi/simple.rb
CHANGED
@@ -10,6 +10,7 @@ module GSSAPI
|
|
10
10
|
class Simple
|
11
11
|
|
12
12
|
attr_reader :context
|
13
|
+
attr_reader :delegated_credentials
|
13
14
|
|
14
15
|
# Initialize a new GSSAPI::Simple object
|
15
16
|
# @param [String] host_name the fully qualified host name
|
@@ -26,6 +27,7 @@ module GSSAPI
|
|
26
27
|
@context = nil # the security context
|
27
28
|
@scred = nil # the service credentials. really only used for the server-side via acquire_credentials
|
28
29
|
set_keytab(keytab) unless keytab.nil?
|
30
|
+
@delegated_credentials = nil
|
29
31
|
end
|
30
32
|
|
31
33
|
|
@@ -61,7 +63,7 @@ module GSSAPI
|
|
61
63
|
# to the remote host. Otherwise it returns true and the GSS security context has been established.
|
62
64
|
def init_context(in_token = nil, opts = {})
|
63
65
|
min_stat = FFI::MemoryPointer.new :OM_uint32
|
64
|
-
|
66
|
+
pctx = (@context.nil? ? LibGSSAPI::GssCtxIdT.gss_c_no_context.address_of : @context.address_of)
|
65
67
|
mech = LibGSSAPI::GssOID.gss_c_no_oid
|
66
68
|
if(opts[:flags])
|
67
69
|
flags = opts[:flags]
|
@@ -78,7 +80,7 @@ module GSSAPI
|
|
78
80
|
|
79
81
|
maj_stat = LibGSSAPI.gss_init_sec_context(min_stat,
|
80
82
|
nil,
|
81
|
-
|
83
|
+
pctx,
|
82
84
|
@int_svc_name,
|
83
85
|
mech,
|
84
86
|
flags,
|
@@ -91,8 +93,13 @@ module GSSAPI
|
|
91
93
|
nil)
|
92
94
|
|
93
95
|
raise GssApiError.new(maj_stat, min_stat), "gss_init_sec_context did not return GSS_S_COMPLETE" if maj_stat > 1
|
94
|
-
|
95
|
-
@context
|
96
|
+
|
97
|
+
# The returned context may be equal to the passed in @context. If so, we
|
98
|
+
# must not create another AutoPointer to the same gss_buffer_t. If we do
|
99
|
+
# we will double delete it.
|
100
|
+
ctx = pctx.get_pointer(0)
|
101
|
+
@context = LibGSSAPI::GssCtxIdT.new(ctx) if ctx != @context
|
102
|
+
|
96
103
|
maj_stat == 1 ? out_tok.value : true
|
97
104
|
end
|
98
105
|
|
@@ -105,7 +112,7 @@ module GSSAPI
|
|
105
112
|
raise GssApiError, "No credentials yet acquired. Call #{self.class.name}#acquire_credentials first" if @scred.nil?
|
106
113
|
|
107
114
|
min_stat = FFI::MemoryPointer.new :OM_uint32
|
108
|
-
|
115
|
+
pctx = (@context.nil? ? LibGSSAPI::GssCtxIdT.gss_c_no_context.address_of : @context.address_of)
|
109
116
|
no_chn_bind = LibGSSAPI::GSS_C_NO_CHANNEL_BINDINGS
|
110
117
|
@client = FFI::MemoryPointer.new :pointer # Will hold the initiating client name after the call
|
111
118
|
mech = FFI::MemoryPointer.new :pointer # Will hold the mech being used after the call
|
@@ -113,9 +120,10 @@ module GSSAPI
|
|
113
120
|
in_tok.value = in_token
|
114
121
|
out_tok = GSSAPI::LibGSSAPI::ManagedGssBufferDesc.new
|
115
122
|
ret_flags = FFI::MemoryPointer.new :OM_uint32
|
123
|
+
delegated_cred_handle = FFI::MemoryPointer.new :pointer
|
116
124
|
|
117
125
|
maj_stat = LibGSSAPI.gss_accept_sec_context(min_stat,
|
118
|
-
|
126
|
+
pctx,
|
119
127
|
@scred,
|
120
128
|
in_tok.pointer,
|
121
129
|
no_chn_bind,
|
@@ -123,11 +131,21 @@ module GSSAPI
|
|
123
131
|
mech,
|
124
132
|
out_tok.pointer,
|
125
133
|
ret_flags,
|
126
|
-
nil,
|
134
|
+
nil,
|
135
|
+
delegated_cred_handle)
|
127
136
|
|
128
137
|
raise GssApiError.new(maj_stat, min_stat), "gss_accept_sec_context did not return GSS_S_COMPLETE" if maj_stat > 1
|
129
138
|
|
130
|
-
|
139
|
+
if (ret_flags.read_uint32 & LibGSSAPI::GSS_C_DELEG_FLAG) != 0
|
140
|
+
@delegated_credentials = LibGSSAPI::GssCredIdT.new(delegated_cred_handle.get_pointer(0))
|
141
|
+
end
|
142
|
+
|
143
|
+
# The returned context may be equal to the passed in @context. If so, we
|
144
|
+
# must not create another AutoPointer to the same gss_buffer_t. If we do
|
145
|
+
# we will double delete it.
|
146
|
+
ctx = pctx.get_pointer(0)
|
147
|
+
@context = LibGSSAPI::GssCtxIdT.new(ctx) if ctx != @context
|
148
|
+
|
131
149
|
out_tok.length > 0 ? out_tok.value : true
|
132
150
|
end
|
133
151
|
|
metadata
CHANGED
@@ -1,45 +1,47 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gssapi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
5
|
-
prerelease:
|
4
|
+
version: 1.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dan Wanek
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-09-20 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: ffi
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - '>='
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: 1.0.1
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - '>='
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 1.0.1
|
30
|
-
description:
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
description: |2
|
28
|
+
A FFI wrapper around the system GSSAPI library. Please make sure and read the
|
29
|
+
Yard docs or standard GSSAPI documentation if you have any questions.
|
30
|
+
|
31
|
+
There is also a class called GSSAPI::Simple that wraps many of the common features
|
32
|
+
used for GSSAPI.
|
34
33
|
email: dan.wanek@gmail.com
|
35
34
|
executables: []
|
36
35
|
extensions: []
|
37
36
|
extra_rdoc_files:
|
38
|
-
- README.
|
37
|
+
- README.md
|
39
38
|
- COPYING
|
39
|
+
- Changelog.md
|
40
40
|
files:
|
41
41
|
- COPYING
|
42
|
-
-
|
42
|
+
- Changelog.md
|
43
|
+
- Gemfile
|
44
|
+
- README.md
|
43
45
|
- Rakefile
|
44
46
|
- VERSION
|
45
47
|
- examples/gss_client.rb
|
@@ -50,6 +52,7 @@ files:
|
|
50
52
|
- gssapi.gemspec
|
51
53
|
- lib/gssapi.rb
|
52
54
|
- lib/gssapi/exceptions.rb
|
55
|
+
- lib/gssapi/extensions.rb
|
53
56
|
- lib/gssapi/heimdal.rb
|
54
57
|
- lib/gssapi/lib_gssapi.rb
|
55
58
|
- lib/gssapi/lib_gssapi_loader.rb
|
@@ -58,7 +61,9 @@ files:
|
|
58
61
|
- test/spec/gssapi_simple_spec.rb
|
59
62
|
- test/spec/test_buffer_spec.rb
|
60
63
|
homepage: http://github.com/zenchild/gssapi
|
61
|
-
licenses:
|
64
|
+
licenses:
|
65
|
+
- MIT
|
66
|
+
metadata: {}
|
62
67
|
post_install_message:
|
63
68
|
rdoc_options:
|
64
69
|
- -x
|
@@ -68,21 +73,19 @@ rdoc_options:
|
|
68
73
|
require_paths:
|
69
74
|
- lib
|
70
75
|
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
-
none: false
|
72
76
|
requirements:
|
73
|
-
- -
|
77
|
+
- - '>='
|
74
78
|
- !ruby/object:Gem::Version
|
75
79
|
version: 1.8.7
|
76
80
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
77
|
-
none: false
|
78
81
|
requirements:
|
79
|
-
- -
|
82
|
+
- - '>='
|
80
83
|
- !ruby/object:Gem::Version
|
81
84
|
version: '0'
|
82
85
|
requirements: []
|
83
86
|
rubyforge_project:
|
84
|
-
rubygems_version:
|
87
|
+
rubygems_version: 2.2.2
|
85
88
|
signing_key:
|
86
|
-
specification_version:
|
89
|
+
specification_version: 4
|
87
90
|
summary: A FFI wrapper around the system GSSAPI library.
|
88
91
|
test_files: []
|
data/README.textile
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
h1. Ruby GSSAPI Library
|
2
|
-
|
3
|
-
p. This is a wrapper around the system GSSAPI library (MIT only at this time). It exposes the low-level GSSAPI methods like gss_init_sec_context and gss_wrap and also provides an easier to use wrapper on top of this for common usage scenarios.
|
4
|
-
|
5
|
-
|
6
|
-
p. I'm going to try and maintain most of the docs in the Github WIKI for this project so please check there for documentation and examples.
|
7
|
-
|
8
|
-
https://github.com/zenchild/gssapi/wiki
|
9
|
-
|
10
|
-
p. Also check out the examples directory for some stubbed out client/server examples.
|
11
|
-
|
12
|
-
|
13
|
-
h4. License
|
14
|
-
|
15
|
-
Copyright © 2010 Dan Wanek <dan.wanek@gmail.com>
|
16
|
-
Ruby gssapi is licensed under the MIT license (see COPYING)
|