yakg 0.1.6 → 0.1.7
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/lib/yakg/backend/macos-keychain.rb +10 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56e1944813606d4ff11f98342041315dd2b016bf
|
4
|
+
data.tar.gz: 063bb9140033899bda0559610717b2c8870bfa37
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0776c9e20ce77fc5f78cf35c5af0b55979ecbfdb2adb99d87738f87e3edbeccdb3c57114c2b9044cd38b37fa0f6a207d72742749174efd98636be525f66b50d4
|
7
|
+
data.tar.gz: bc7aea370c652082f112e909116c274eb033523c7af1fae044b0b5ce1d590afe1d237778361acd38f357d246b2ee0cf497dc519b2666d130ae0ae3c3a92110ed
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.7
|
@@ -17,7 +17,8 @@ class Yakg
|
|
17
17
|
|
18
18
|
extend FFI::Library
|
19
19
|
NULL = FFI::Pointer::NULL
|
20
|
-
|
20
|
+
# should be FFI::Library::LIBC, but https://github.com/ffi/ffi/issues/461
|
21
|
+
ffi_lib("/usr/lib/libc.dylib",
|
21
22
|
framework(:CoreFoundation),
|
22
23
|
framework(:Security))
|
23
24
|
|
@@ -63,7 +64,7 @@ class Yakg
|
|
63
64
|
raise KeychainError.new(error_message code) if code != 0
|
64
65
|
code
|
65
66
|
end
|
66
|
-
|
67
|
+
|
67
68
|
def delete acct, svc
|
68
69
|
pw_length = FFI::MemoryPointer.new :uint32
|
69
70
|
pw_val = FFI::MemoryPointer.new :pointer
|
@@ -124,7 +125,7 @@ class Yakg
|
|
124
125
|
def s2i s
|
125
126
|
s.unpack("N")[0].to_i
|
126
127
|
end
|
127
|
-
|
128
|
+
|
128
129
|
enum :SecItemAttr, [:kSecCreatiofnDateItemAttr, s2i('cdat'),
|
129
130
|
:kSecModDateItemAttr, s2i('mdat'),
|
130
131
|
:kSecDescriptionItemAttr, s2i('desc'),
|
@@ -154,7 +155,7 @@ class Yakg
|
|
154
155
|
:kSecCrlEncoding, s2i('crnc'),
|
155
156
|
:kSecAlias, s2i('alis')
|
156
157
|
]
|
157
|
-
|
158
|
+
|
158
159
|
class SecKeychainAttribute < FFI::Struct
|
159
160
|
layout(:tag, :SecItemAttr,
|
160
161
|
:length, :uint32,
|
@@ -166,7 +167,7 @@ class Yakg
|
|
166
167
|
:tag, :pointer,
|
167
168
|
:format, :pointer)
|
168
169
|
end
|
169
|
-
|
170
|
+
|
170
171
|
def list svc
|
171
172
|
search_ref = FFI::MemoryPointer.new :pointer
|
172
173
|
found_item = FFI::MemoryPointer.new :pointer
|
@@ -179,7 +180,7 @@ class Yakg
|
|
179
180
|
acct_info[:tag].write_array_of_int [s2i("acct")]
|
180
181
|
acct_info[:format] = FFI::MemoryPointer.new :uint32
|
181
182
|
acct_info[:format].write_array_of_int [0]
|
182
|
-
|
183
|
+
|
183
184
|
svc_attr[:tag] = s2i "svce"
|
184
185
|
svc_attr[:length] = svc.length
|
185
186
|
svc_attr[:data] = FFI::MemoryPointer.from_string(svc)
|
@@ -187,7 +188,7 @@ class Yakg
|
|
187
188
|
search_attr_list = SecKeychainAttributeList.new
|
188
189
|
search_attr_list[:count] = 1
|
189
190
|
search_attr_list[:attr] = svc_attr.pointer
|
190
|
-
|
191
|
+
|
191
192
|
raise_error? SecKeychainSearchCreateFromAttributes(NULL,
|
192
193
|
s2i("genp"),
|
193
194
|
search_attr_list,
|
@@ -218,10 +219,10 @@ class Yakg
|
|
218
219
|
raise_error? SecKeychainItemFreeAttributesAndData(found_attr_list.read_pointer,
|
219
220
|
NULL)
|
220
221
|
CFRelease search_ref.read_pointer
|
221
|
-
|
222
|
+
|
222
223
|
acct_names
|
223
224
|
end
|
224
225
|
|
225
|
-
end
|
226
|
+
end
|
226
227
|
end
|
227
228
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yakg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tom Maher
|
@@ -563,7 +563,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
563
563
|
version: '0'
|
564
564
|
requirements: []
|
565
565
|
rubyforge_project:
|
566
|
-
rubygems_version: 2.
|
566
|
+
rubygems_version: 2.4.5.1
|
567
567
|
signing_key:
|
568
568
|
specification_version: 4
|
569
569
|
summary: Yet Another Keyring Gem
|