universa 3.11.4.1 → 3.11.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c78e13c642b8de00b625099b161f024ac93b207226424feda70faaaa6396d469
4
- data.tar.gz: d59b1e4ed9d2213fe0e64f0aa5789fca8e0bfd99f8a4095469ac4032d3c17eef
3
+ metadata.gz: 4dc48dd7a2c4439feca486ee1898f186005c383bb9887c47e91144064eeda405
4
+ data.tar.gz: 32f4cede12c7977effc924295b769d9274952c2b0d2edfd68a784f74e87ffbe1
5
5
  SHA512:
6
- metadata.gz: 5a378d3f84ef0b9be76fd1eeb5274eb5a75e293f2242fd9eff95573727bfeee74fece46ab0e1df244bea7f75c43d65697fcfc1dfa82b92279d7e510b5a015e3b
7
- data.tar.gz: 1558ea12f627bed89cac34e02e7b81d20c1b7e8146d51a7ebad653d9ff657439a3b23a697a14ee220467995afed3629636cfa281676e21236c4d47594826e507
6
+ metadata.gz: d23f3bcc176f4773f14073d82564ae23f68bd3d355c92425127a6ea883dbf079927d58d94ddbe4420d5365f655e6b1b1cd900de89341ff1d4338a5ef3c59f66e
7
+ data.tar.gz: 2f6c3c7c7a2ea0a95b3747f4d9222e836c52dcac32a3eb8b7bed11959ab0b8502c4cfff9792ef5c7e56ed595a9ddf392a3637c48d623e302344cbe01d837758f
data/.gitignore CHANGED
@@ -16,3 +16,4 @@ Gemfile.lock
16
16
  .DS_Store
17
17
  /*.private.unikey
18
18
  /umi.log
19
+ /umisession.log
data/bin/umi/bin/umi CHANGED
@@ -344,7 +344,7 @@ declare -r lib_dir="$(realpath "${app_home}/../lib")"
344
344
  declare -a app_mainclass=(com.icodici.farcallscala.Main)
345
345
 
346
346
  declare -r script_conf_file="${app_home}/../conf/application.ini"
347
- declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.53.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.11.4.jar:$lib_dir/org.yaml.snakeyaml-1.18.jar:$lib_dir/com.icodici.nanohttpd-2.1.0.jar:$lib_dir/com.icodici.common_tools-3.11.4.jar:$lib_dir/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar:$lib_dir/net.java.dev.jna.jna-4.5.1.jar:$lib_dir/org.checkerframework.checker-qual-2.3.2.jar:$lib_dir/com.icodici.crypto-3.11.4.jar:$lib_dir/org.bouncycastle.bcprov-jdk15on-1.62.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/com.typesafe.play.play-json_2.12-2.6.10.jar:$lib_dir/com.typesafe.play.play-functional_2.12-2.6.10.jar:$lib_dir/org.scala-lang.scala-reflect-2.12.7.jar:$lib_dir/org.typelevel.macro-compat_2.12-1.1.1.jar:$lib_dir/joda-time.joda-time-2.9.9.jar:$lib_dir/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar:$lib_dir/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar:$lib_dir/net.java.dev.jna.jna-platform-4.5.0.jar:$lib_dir/net.sf.jopt-simple.jopt-simple-4.9.jar"
347
+ declare -r app_classpath="$lib_dir/com.icodici.umi-0.8.57.jar:$lib_dir/org.scala-lang.scala-library-2.12.7.jar:$lib_dir/com.icodici.universa_core-3.11.4.2.jar:$lib_dir/org.yaml.snakeyaml-1.18.jar:$lib_dir/com.icodici.nanohttpd-2.1.0.jar:$lib_dir/com.icodici.common_tools-3.11.4.2.jar:$lib_dir/com.eclipsesource.minimal-json.minimal-json-0.9.4.jar:$lib_dir/net.java.dev.jna.jna-4.5.1.jar:$lib_dir/org.checkerframework.checker-qual-2.3.2.jar:$lib_dir/com.icodici.crypto-3.11.4.2.jar:$lib_dir/org.bouncycastle.bcprov-jdk15on-1.62.jar:$lib_dir/com.squareup.jnagmp.jnagmp-2.0.0.jar:$lib_dir/com.typesafe.play.play-json_2.12-2.6.10.jar:$lib_dir/com.typesafe.play.play-functional_2.12-2.6.10.jar:$lib_dir/org.scala-lang.scala-reflect-2.12.7.jar:$lib_dir/org.typelevel.macro-compat_2.12-1.1.1.jar:$lib_dir/joda-time.joda-time-2.9.9.jar:$lib_dir/com.fasterxml.jackson.core.jackson-core-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar:$lib_dir/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar:$lib_dir/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar:$lib_dir/org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar:$lib_dir/net.java.dev.jna.jna-platform-4.5.0.jar:$lib_dir/net.sf.jopt-simple.jopt-simple-4.9.jar"
348
348
 
349
349
  # java_cmd is overrode in process_args when -java-home is used
350
350
  declare java_cmd=$(get_java_cmd)
data/bin/umi/bin/umi.bat CHANGED
@@ -80,7 +80,7 @@ rem "-J" is stripped, "-D" is left as is, and everything is appended to JAVA_OPT
80
80
  set _JAVA_PARAMS=
81
81
  set _APP_ARGS=
82
82
 
83
- set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.53.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.11.4.jar;%APP_LIB_DIR%\org.yaml.snakeyaml-1.18.jar;%APP_LIB_DIR%\com.icodici.nanohttpd-2.1.0.jar;%APP_LIB_DIR%\com.icodici.common_tools-3.11.4.jar;%APP_LIB_DIR%\com.eclipsesource.minimal-json.minimal-json-0.9.4.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-4.5.1.jar;%APP_LIB_DIR%\org.checkerframework.checker-qual-2.3.2.jar;%APP_LIB_DIR%\com.icodici.crypto-3.11.4.jar;%APP_LIB_DIR%\org.bouncycastle.bcprov-jdk15on-1.62.jar;%APP_LIB_DIR%\com.squareup.jnagmp.jnagmp-2.0.0.jar;%APP_LIB_DIR%\com.typesafe.play.play-json_2.12-2.6.10.jar;%APP_LIB_DIR%\com.typesafe.play.play-functional_2.12-2.6.10.jar;%APP_LIB_DIR%\org.scala-lang.scala-reflect-2.12.7.jar;%APP_LIB_DIR%\org.typelevel.macro-compat_2.12-1.1.1.jar;%APP_LIB_DIR%\joda-time.joda-time-2.9.9.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-core-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar;%APP_LIB_DIR%\org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-platform-4.5.0.jar;%APP_LIB_DIR%\net.sf.jopt-simple.jopt-simple-4.9.jar"
83
+ set "APP_CLASSPATH=%APP_LIB_DIR%\com.icodici.umi-0.8.57.jar;%APP_LIB_DIR%\org.scala-lang.scala-library-2.12.7.jar;%APP_LIB_DIR%\com.icodici.universa_core-3.11.4.2.jar;%APP_LIB_DIR%\org.yaml.snakeyaml-1.18.jar;%APP_LIB_DIR%\com.icodici.nanohttpd-2.1.0.jar;%APP_LIB_DIR%\com.icodici.common_tools-3.11.4.2.jar;%APP_LIB_DIR%\com.eclipsesource.minimal-json.minimal-json-0.9.4.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-4.5.1.jar;%APP_LIB_DIR%\org.checkerframework.checker-qual-2.3.2.jar;%APP_LIB_DIR%\com.icodici.crypto-3.11.4.2.jar;%APP_LIB_DIR%\org.bouncycastle.bcprov-jdk15on-1.62.jar;%APP_LIB_DIR%\com.squareup.jnagmp.jnagmp-2.0.0.jar;%APP_LIB_DIR%\com.typesafe.play.play-json_2.12-2.6.10.jar;%APP_LIB_DIR%\com.typesafe.play.play-functional_2.12-2.6.10.jar;%APP_LIB_DIR%\org.scala-lang.scala-reflect-2.12.7.jar;%APP_LIB_DIR%\org.typelevel.macro-compat_2.12-1.1.1.jar;%APP_LIB_DIR%\joda-time.joda-time-2.9.9.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-core-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-annotations-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar;%APP_LIB_DIR%\com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar;%APP_LIB_DIR%\com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar;%APP_LIB_DIR%\org.scala-sbt.ipcsocket.ipcsocket-1.0.0.jar;%APP_LIB_DIR%\net.java.dev.jna.jna-platform-4.5.0.jar;%APP_LIB_DIR%\net.sf.jopt-simple.jopt-simple-4.9.jar"
84
84
  set "APP_MAIN_CLASS=com.icodici.farcallscala.Main"
85
85
  set "SCRIPT_CONF_FILE=%APP_HOME%\conf\application.ini"
86
86
 
data/exe/unikeys CHANGED
@@ -11,3 +11,5 @@ end
11
11
  require 'universa/tools'
12
12
  require 'universa/keytool/keytool'
13
13
 
14
+
15
+
@@ -2,6 +2,38 @@ require 'bigdecimal'
2
2
 
3
3
  module Universa
4
4
 
5
+ # Adapter for com.icodici.crypto
6
+ class KeyInfo < RemoteAdapter
7
+ remote_class "com.icodici.crypto.KeyInfo"
8
+ end
9
+
10
+ # Derive symmetric key from a password using PBKDF2 algorithm
11
+ def derive_key(password, salt, rounds: 50000, prf: "HMAC_SHA256", tag: "default_tag")
12
+ salt.is_a?(String) and salt = salt.force_encoding('binary')
13
+ tag && tag.is_a?(String) and tag = tag.force_encoding('binary')
14
+ ki = KeyInfo.new(prf, rounds, salt, tag)
15
+ ki.derivePassword(password)
16
+ end
17
+
18
+ # Utiliy to generate keys of arbitrary length derived from passwords using PBKDF2 algorithm. Use
19
+ # {#derive} to produce keys from passwords in a realtively safe way (safety depends on the password strength)
20
+ class PBKDF2 < RemoteAdapter
21
+ remote_class "com.icodici.crypto.PBKDF2"
22
+
23
+ # Derive a binary key from the string password using PBKDF2 algorithm.
24
+ #
25
+ # @param [String] password to derive key from
26
+ # @param [String] salt
27
+ # @param [Integer] rounds using in the PNKDF2 generation
28
+ # @param [String] hash class name, should include packgae name. See Universa crypto Digest class
29
+ # @param [Integer] length of the derived key.
30
+ # @return [Binary] binary string with generated key
31
+ def self.derive(password, salt: "default_salt", rounds: 50000, hash: 'com.icodici.crypto.digest.Sha256', length: 32)
32
+ salt = salt.force_encoding('binary') if salt && salt.is_a?(String)
33
+ invoke_static :derive, hash, password, salt, rounds, length
34
+ end
35
+ end
36
+
5
37
  # Adapter for Universa ChangeOwnerPermission
6
38
  class ChangeOwnerPermission < RemoteAdapter
7
39
  remote_class "com.icodici.universa.contract.permissions.ChangeOwnerPermission"
@@ -316,7 +348,7 @@ module Universa
316
348
  # trace found errors (call it afer check()): the Java version will not be able to trace to the
317
349
  # process stdout, so we reqrite it here
318
350
  def trace_errors
319
- getErrors.each {|e|
351
+ getErrors.each { |e|
320
352
  puts "(#{e.object || ''}): #{e.error}"
321
353
  }
322
354
  end
@@ -325,7 +357,7 @@ module Universa
325
357
  #
326
358
  # @return [String] possibly empty ''
327
359
  def errors_string
328
- getErrors.map {|e| "(#{e.object || ''}): #{e.error}"}.join(', ').strip
360
+ getErrors.map { |e| "(#{e.object || ''}): #{e.error}" }.join(', ').strip
329
361
  end
330
362
 
331
363
  # Test that some set of keys could be used to perform some role.
@@ -333,7 +365,7 @@ module Universa
333
365
  # @param [String] name of the role to check
334
366
  # @param [PublicKey] keys instances to check against
335
367
  def can_perform_role(name, *keys)
336
- getRole(name.to_s).isAllowedForKeys(Set.new keys.map {|x|
368
+ getRole(name.to_s).isAllowedForKeys(Set.new keys.map { |x|
337
369
  x.is_a?(PrivateKey) ? x.public_key : x
338
370
  })
339
371
  end
@@ -121,15 +121,6 @@ class KeyTool
121
121
  opts.banner = ANSI.bold { "\nUniversa Key tool #{Universa::VERSION}" }
122
122
  opts.separator ""
123
123
 
124
- # opts.on("-k", "--key KEY_FILE",
125
- # "load the access key from the specified file. By default, looks in", "#{options.key_path}") do |file_name|
126
- # options.key_path = File.expand_path(file_name)
127
- # end
128
- #
129
- # opts.on("-n", "--node name", "node to connect, without protocol, e.g. 'node-7-com.universa.io'") do |node|
130
- # options.node = node
131
- # end
132
- #
133
124
  opts.on("--no-password",
134
125
  "create resources not protected by password. Not recommended.") { |x|
135
126
  @require_password = x
@@ -241,7 +232,6 @@ See project home page at #{ANSI.underline { "https://github.com/sergeych/univers
241
232
  end
242
233
  }
243
234
 
244
- ## D_TIsYOfFQ2WejhG3
245
235
  begin
246
236
  opt_parser.order!
247
237
  if @tasks.empty?
@@ -27,7 +27,7 @@ module Universa
27
27
  [Contract, PrivateKey, PublicKey, KeyAddress, HashId, Binder,
28
28
  Role, SimpleRole, RoleLink, ListRole,
29
29
  ChangeOwnerPermission, RevokePermission, ModifyDataPermission, SplitJoinPermission,
30
- UmiClient, Duration, Compound].each {|klass| register_proxy klass}
30
+ UmiClient, Duration, Compound, KeyInfo, PBKDF2].each {|klass| register_proxy klass}
31
31
  end
32
32
 
33
33
  # Implementation of {Service.configure}
@@ -1,4 +1,4 @@
1
1
  module Universa
2
2
  # Current gem version
3
- VERSION = "3.11.4.1"
3
+ VERSION = "3.11.4.2"
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: universa
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.11.4.1
4
+ version: 3.11.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - sergeych
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-19 00:00:00.000000000 Z
11
+ date: 2019-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: farcall
@@ -151,11 +151,11 @@ files:
151
151
  - bin/umi/lib/com.fasterxml.jackson.core.jackson-databind-2.8.11.1.jar
152
152
  - bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jdk8-2.8.11.jar
153
153
  - bin/umi/lib/com.fasterxml.jackson.datatype.jackson-datatype-jsr310-2.8.11.jar
154
- - bin/umi/lib/com.icodici.common_tools-3.11.4.jar
155
- - bin/umi/lib/com.icodici.crypto-3.11.4.jar
154
+ - bin/umi/lib/com.icodici.common_tools-3.11.4.2.jar
155
+ - bin/umi/lib/com.icodici.crypto-3.11.4.2.jar
156
156
  - bin/umi/lib/com.icodici.nanohttpd-2.1.0.jar
157
- - bin/umi/lib/com.icodici.umi-0.8.53.jar
158
- - bin/umi/lib/com.icodici.universa_core-3.11.4.jar
157
+ - bin/umi/lib/com.icodici.umi-0.8.57.jar
158
+ - bin/umi/lib/com.icodici.universa_core-3.11.4.2.jar
159
159
  - bin/umi/lib/com.squareup.jnagmp.jnagmp-2.0.0.jar
160
160
  - bin/umi/lib/com.typesafe.play.play-functional_2.12-2.6.10.jar
161
161
  - bin/umi/lib/com.typesafe.play.play-json_2.12-2.6.10.jar