Skip to content
This repository has been archived by the owner on Feb 1, 2021. It is now read-only.

Commit

Permalink
Merge branch 'release/0.2.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Aug 28, 2018
2 parents 88d555d + 1ad0783 commit 3647f00
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ allprojects {

In your application `build.gradle`:
```groovy
def uport_sdk_version = "v0.2.0"
def uport_sdk_version = "v0.2.1"
dependencies {
...
// core SDK
Expand Down Expand Up @@ -140,6 +140,9 @@ but that may be removed when pure kotlin implementations of the required cryptog

### Changelog

* 0.2.1
* bugfix: crash when decrypting fingerprint protected seed

* 0.2.0
* add `:ethr-did` module with support for [resolving `ethr-did`s](https://github.com/uport-project/ethr-did-resolver)
* move [uport-android-signer](https://github.com/uport-project/uport-android-signer) into this SDK as `:signer` module
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ buildscript {
kethereum_version = "0.53"
khex_version = "0.5"

uport_sdk_version = "0.2.0"
uport_sdk_version = "0.2.1"
}

repositories {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class FingerprintAsymmetricProtection : KeyProtection() {
fun decrypt(context: Context, purpose: String, ciphertext: String, callback: DecryptionCallback) {

try {
val (encryptedBytes) = unpackCiphertext(ciphertext)
val (_, encryptedBytes) = unpackCiphertext(ciphertext)

val cipher = getWrappingCipher(Cipher.DECRYPT_MODE, alias)

Expand Down
34 changes: 34 additions & 0 deletions signer/src/test/java/com/uport/sdk/signer/ExtensionsKtTest.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.uport.sdk.signer

import org.junit.Test

import org.junit.Assert.*

class ExtensionsKtTest {

@Test
fun `can pack ciphertext and iv`() {
val data = listOf("iv", "cipher").map { it.toByteArray() }.toTypedArray()
val packed = packCiphertext(*data)
val (iv, cipher) = unpackCiphertext(packed)
assertEquals("cipher", String(cipher))
assertEquals("iv", String(iv))
}

@Test
fun `can pack empty iv and ciphertext`() {
val data = arrayOf(byteArrayOf(), "cipher".toByteArray())
val packed = packCiphertext(*data)
val (iv, cipher) = unpackCiphertext(packed)
assertEquals("cipher", String(cipher))
assertEquals("", String(iv))
}

@Test
fun `can pack only ciphertext`() {
val data = arrayOf("cipher".toByteArray())
val packed = packCiphertext(*data)
val (cipher) = unpackCiphertext(packed)
assertEquals("cipher", String(cipher))
}
}

0 comments on commit 3647f00

Please sign in to comment.