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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: cb1d444d6f433d9ffeabe949c3bf81a53c63ddb2
4
- data.tar.gz: dff3c345d379966697a50b67bd1a48c898d74d3a
3
+ metadata.gz: de5d62e7e283961bb954ca220ca6030322402579
4
+ data.tar.gz: aa3d870e0d98491507c31a7c9b0a940a2ae9e080
5
5
  SHA512:
6
- metadata.gz: f2e7a57423d0418013513aa59b612994ade13bc61fc87fe688b6c9227a409feb2daf7480f7694134bf23b10b9fb09263c82889bb19b825ef5582b426f233024d
7
- data.tar.gz: 15bf94ce92327311a9ef7d8c9a817d1ccc00bd42f8ba4380ef0b823147cd85138b483f938af017b3865ea8a0927bbf88502601061cfa427dd6d5267882821fb1
6
+ metadata.gz: c303a80aba6fc387e742a664569b834a319e448f7cea11eafc5cf3c701e74989c6cb72dedae06b8ab5247b00b6ceee19aef2ef11bb592e606d80acdb348a9382
7
+ data.tar.gz: 907e4a14ec7157815e56d07bcf5b7d6aa57a28f60d07f173c2e1e001752e17f2e2a778bd83ca412774bf1986e61b10ae003ecba9314a2a78996ef5be893f88e7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.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.2 ruby lib
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.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
@@ -1,5 +1,4 @@
1
1
  require 'krb5/keytab'
2
2
 
3
3
  class KRB5
4
- VERSION = '0.2.2'
5
4
  end
@@ -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
@@ -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
 
@@ -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
  #
@@ -33,11 +33,9 @@ class KRB5
33
33
  @bytes = []
34
34
 
35
35
  pack_count_of_components
36
- pack_int16(realm.length)
37
- pack_bytes(realm)
36
+ pack_data(realm)
38
37
  components.each do |component|
39
- pack_int16(component.length)
40
- pack_bytes(component)
38
+ pack_data(component)
41
39
  end
42
40
  pack_int32(name_type)
43
41
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: krb5-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Barnett