From 10100920bcb4838a75b013f5d97228b72ca5881f Mon Sep 17 00:00:00 2001 From: jakob <jakob.bode@fu-berlin.de> Date: Sun, 13 Jan 2019 01:30:43 +0100 Subject: [PATCH] update Travellib --- Podfile.lock | 2 +- Pods/Manifest.lock | 2 +- Pods/Travellib/Travellib/Travellib/Crypto.swift | 9 +++++---- Pods/Travellib/Travellib/Travellib/Traveler.swift | 10 ++++++++++ 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Podfile.lock b/Podfile.lock index 23693f2..86f2095 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -55,7 +55,7 @@ CHECKOUT OPTIONS: :commit: e6b4597d3bbff232e63f50942318f2b4d3523b1b :git: https://github.com/MailCore/mailcore2.git Travellib: - :commit: 9ce858d03a21e139b7bfa069d219942875aec8f1 + :commit: 2675c5df3d209d97311aa9ad552427f99a27a6ae :git: https://git.imp.fu-berlin.de/jakobsbode/travellib.git SPEC CHECKSUMS: diff --git a/Pods/Manifest.lock b/Pods/Manifest.lock index 23693f2..86f2095 100644 --- a/Pods/Manifest.lock +++ b/Pods/Manifest.lock @@ -55,7 +55,7 @@ CHECKOUT OPTIONS: :commit: e6b4597d3bbff232e63f50942318f2b4d3523b1b :git: https://github.com/MailCore/mailcore2.git Travellib: - :commit: 9ce858d03a21e139b7bfa069d219942875aec8f1 + :commit: 2675c5df3d209d97311aa9ad552427f99a27a6ae :git: https://git.imp.fu-berlin.de/jakobsbode/travellib.git SPEC CHECKSUMS: diff --git a/Pods/Travellib/Travellib/Travellib/Crypto.swift b/Pods/Travellib/Travellib/Travellib/Crypto.swift index 552a801..e9e5ed5 100644 --- a/Pods/Travellib/Travellib/Travellib/Crypto.swift +++ b/Pods/Travellib/Travellib/Travellib/Crypto.swift @@ -232,7 +232,7 @@ public class Crypto { /* requires alphabet to have a maximal length of 256 */ - static func createRandom(characters: Int, alphabet: [String]) throws -> String { + public static func createRandom(characters: Int, alphabet: [String]) throws -> String { guard alphabet.count <= 256 else { throw TravelError.invalidAlphabet } @@ -253,7 +253,7 @@ public class Crypto { //bits should be less or equal to 64, more bits will not be considered at the moment //alphabet should contian maximal 256 symbols at the moment - static func createRandom(bits: Int, alphabet: [String]) throws -> String { + public static func createRandom(bits: Int, alphabet: [String]) throws -> String { guard alphabet.count <= 256 else { throw TravelError.invalidAlphabet } @@ -265,7 +265,7 @@ public class Crypto { return result } - static func convertToPassword(number: UInt64, alphabet: [String], bits: Int) throws -> String { + public static func convertToPassword(number: UInt64, alphabet: [String], bits: Int) throws -> String { guard alphabet.count <= 256 else { throw TravelError.invalidAlphabet } @@ -285,7 +285,7 @@ public class Crypto { return result } - static func convertToNumber(password: String, alphabet: [String]) throws -> UInt64 { + public static func convertToNumber(password: String, alphabet: [String]) throws -> UInt64 { var result: UInt64 = 0 var pw = password for _ in 0 ..< pw.count { @@ -300,6 +300,7 @@ public class Crypto { return result } + //TODO: remove func bitsNotZero(value: UInt64) -> [Int] { var temp = value var result: [Int] = [] diff --git a/Pods/Travellib/Travellib/Travellib/Traveler.swift b/Pods/Travellib/Travellib/Travellib/Traveler.swift index de6b6b4..8334862 100644 --- a/Pods/Travellib/Travellib/Travellib/Traveler.swift +++ b/Pods/Travellib/Travellib/Travellib/Traveler.swift @@ -171,6 +171,16 @@ public class Traveler: Codable { return keys } + //returns the address that may be used to backup secretkeys while traveling + public func getTravelerAddress() -> String { + return travelerAddress + } + + //returns the key that may be used to backup secretkeys while traveling + public func getTravelerKey() -> String { + return travelerKey + } + public func deletePasswordReference() { pw1 = "" pw2 = "" -- GitLab