self_crypto 0.0.6 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 73eca72eccdafd451e608539b1b3ca79e344ff359f6b4665ccb400bcd8228a96
4
- data.tar.gz: 80b460665fb84005612a6236eca92dc99c640c1750f0cce282c31ff5acdafce9
3
+ metadata.gz: c80522a003146eb903859a9fc2007546dc76ff94e599b3eaceccbe328b753fbb
4
+ data.tar.gz: a1a7eb743ed6b4c22d0a9b70c33f9aba491d6bf88a02bba32dbbb4659c570621
5
5
  SHA512:
6
- metadata.gz: 85eeecb3fc6132ce712648f4490513ce4ee03e833c6eeeb6ae90211158bb6d576492c931f3f67f863fdd682f99a02a89709966c5ab4dfd34ea917bf9cc803efc
7
- data.tar.gz: 1a6bd6df98128d36ce74225fcb83c17db9e3eb19a315ad0570760a2835248ecbea876e6d4408ecfd5940290829ea2f0c24311514aa7b36e7fd5ee6cf4fc7f4b7
6
+ metadata.gz: c8bf46420a38dda34c0574ecbc9ee785290dd2d3bcd94db3513547e65fe750c9cec0c835da24043224fb3d08bb318b47263e5753ff43d6ab55569cafd8ae4f3b
7
+ data.tar.gz: 785ee198c7345c1fa6ead3df9211181de418045cc33979c414b2f150d73f43b8303edc0be6469179c3f03e4acbe262d33834be3fcec5ba371fee41fada314ef7
@@ -46,24 +46,17 @@ static VALUE initialize(int argc, VALUE *argv, VALUE self)
46
46
  }
47
47
 
48
48
  if(pickle != Qnil){
49
-
50
49
  if(olm_unpickle_account(this, RSTRING_PTR(password), RSTRING_LEN(password), RSTRING_PTR(dup_string(pickle)), RSTRING_LEN(pickle)) == olm_error()){
51
-
52
50
  raise_olm_error(olm_account_last_error(this));
53
51
  }
54
- }
55
- if(seed != Qnil){
52
+ } else if(seed != Qnil){
56
53
  if(olm_create_account_derrived_keys(this, RSTRING_PTR(seed), RSTRING_LEN(seed)) == olm_error()){
57
-
58
54
  raise_olm_error(olm_account_last_error(this));
59
55
  }
60
- }
61
- else{
62
-
56
+ } else {
63
57
  size = olm_create_account_random_length(this);
64
58
 
65
59
  if(olm_create_account(this, RSTRING_PTR(get_random(size)), size) == olm_error()){
66
-
67
60
  raise_olm_error(olm_account_last_error(this));
68
61
  }
69
62
  }
@@ -1,5 +1,5 @@
1
1
  module SelfCrypto
2
2
 
3
- VERSION="0.0.6"
3
+ VERSION="0.0.7"
4
4
 
5
5
  end
@@ -95,6 +95,16 @@ describe "Account" do
95
95
 
96
96
  end
97
97
 
98
+ describe "#inbound_session from pickled account" do
99
+
100
+ let(:remote_session){ remote.outbound_session(account.ik['curve25519'], account.otk['curve25519'].values.first) }
101
+ let(:remote_message){ remote_session.encrypt("hello") }
102
+ let(:pickled_account){ account.to_pickle("test") }
103
+ let(:unpickled_account){ SelfCrypto::Account.from_pickle(pickled_account, "test") }
104
+ it("creates session") { _(unpickled_account.inbound_session(remote_message, remote.ik['curve25519'])).must_be_kind_of SelfCrypto::Session }
105
+
106
+ end
107
+
98
108
  end
99
109
 
100
110
  end
@@ -25,10 +25,6 @@ class TestAccount < Minitest::Test
25
25
  assert_equal OlmError::SUCCESS, @state.last_error
26
26
  end
27
27
 
28
- def test_sign
29
- assert_instance_of String, @state.sign("hello")
30
- end
31
-
32
28
  def test_mark_keys_as_published
33
29
  assert_equal @state, @state.mark_keys_as_published
34
30
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: self_crypto
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Bevan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-10-16 00:00:00.000000000 Z
12
+ date: 2020-10-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler