krb5-ruby 0.2.2 → 0.2.3
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/VERSION +1 -1
- data/krb5-ruby.gemspec +2 -2
- data/lib/krb5.rb +0 -1
- data/lib/krb5/keytab_parser.rb +0 -15
- data/lib/krb5/mixin/packer.rb +15 -0
- data/lib/krb5/mixin/unpacker.rb +15 -0
- data/lib/krb5/principal.rb +2 -4
- 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: de5d62e7e283961bb954ca220ca6030322402579
|
4
|
+
data.tar.gz: aa3d870e0d98491507c31a7c9b0a940a2ae9e080
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c303a80aba6fc387e742a664569b834a319e448f7cea11eafc5cf3c701e74989c6cb72dedae06b8ab5247b00b6ceee19aef2ef11bb592e606d80acdb348a9382
|
7
|
+
data.tar.gz: 907e4a14ec7157815e56d07bcf5b7d6aa57a28f60d07f173c2e1e001752e17f2e2a778bd83ca412774bf1986e61b10ae003ecba9314a2a78996ef5be893f88e7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/krb5-ruby.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: krb5-ruby 0.2.
|
5
|
+
# stub: krb5-ruby 0.2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "krb5-ruby".freeze
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib".freeze]
|
data/lib/krb5.rb
CHANGED
data/lib/krb5/keytab_parser.rb
CHANGED
@@ -149,20 +149,5 @@ class KRB5
|
|
149
149
|
key_length = unpack_int16
|
150
150
|
unpack_bytes(key_length)
|
151
151
|
end
|
152
|
-
|
153
|
-
#
|
154
|
-
# Generic method to unpack Kerberos data
|
155
|
-
#
|
156
|
-
# data ::=
|
157
|
-
# length (16 bits)
|
158
|
-
# value (length bytes)
|
159
|
-
#
|
160
|
-
# See: https://web.mit.edu/kerberos/krb5-1.16/doc/formats/keytab_file_format.html
|
161
|
-
#
|
162
|
-
# @return [String]
|
163
|
-
def unpack_data
|
164
|
-
length = unpack_int16
|
165
|
-
data = unpack_bytes(length)
|
166
|
-
end
|
167
152
|
end
|
168
153
|
end
|
data/lib/krb5/mixin/packer.rb
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
class KRB5
|
2
2
|
module Mixin
|
3
3
|
module Packer
|
4
|
+
#
|
5
|
+
# Generic method to pack Kerberos data
|
6
|
+
#
|
7
|
+
# data ::=
|
8
|
+
# length (16 bits)
|
9
|
+
# value (length bytes)
|
10
|
+
#
|
11
|
+
# See: https://web.mit.edu/kerberos/krb5-1.16/doc/formats/keytab_file_format.html
|
12
|
+
#
|
13
|
+
# @return [String]
|
14
|
+
def pack_data(data)
|
15
|
+
pack_int16(data.length)
|
16
|
+
pack_bytes(data)
|
17
|
+
end
|
18
|
+
|
4
19
|
def pack_bytes(data)
|
5
20
|
@bytes ||= []
|
6
21
|
|
data/lib/krb5/mixin/unpacker.rb
CHANGED
@@ -1,6 +1,21 @@
|
|
1
1
|
class KRB5
|
2
2
|
module Mixin
|
3
3
|
module Unpacker
|
4
|
+
#
|
5
|
+
# Generic method to unpack Kerberos data
|
6
|
+
#
|
7
|
+
# data ::=
|
8
|
+
# length (16 bits)
|
9
|
+
# value (length bytes)
|
10
|
+
#
|
11
|
+
# See: https://web.mit.edu/kerberos/krb5-1.16/doc/formats/keytab_file_format.html
|
12
|
+
#
|
13
|
+
# @return [String]
|
14
|
+
def unpack_data
|
15
|
+
length = unpack_int16
|
16
|
+
data = unpack_bytes(length)
|
17
|
+
end
|
18
|
+
|
4
19
|
#
|
5
20
|
# Unpack raw bytes
|
6
21
|
#
|
data/lib/krb5/principal.rb
CHANGED
@@ -33,11 +33,9 @@ class KRB5
|
|
33
33
|
@bytes = []
|
34
34
|
|
35
35
|
pack_count_of_components
|
36
|
-
|
37
|
-
pack_bytes(realm)
|
36
|
+
pack_data(realm)
|
38
37
|
components.each do |component|
|
39
|
-
|
40
|
-
pack_bytes(component)
|
38
|
+
pack_data(component)
|
41
39
|
end
|
42
40
|
pack_int32(name_type)
|
43
41
|
|