Move DirectoryUtil up to parent.

This commit is contained in:
Moxie Marlinspike 2014-11-12 09:17:08 -08:00
parent cd9b20dc9d
commit 28cb1ed85b
3 changed files with 22 additions and 4 deletions

View File

@ -45,7 +45,7 @@ import org.whispersystems.jobqueue.JobManager;
import org.whispersystems.libaxolotl.util.guava.Optional;
import org.whispersystems.textsecure.api.TextSecureAccountManager;
import org.whispersystems.textsecure.push.ContactTokenDetails;
import org.whispersystems.textsecure.util.DirectoryUtil;
import org.thoughtcrime.securesms.util.DirectoryUtil;
import org.whispersystems.textsecure.util.InvalidNumberException;
import java.io.IOException;

View File

@ -11,7 +11,6 @@ import org.thoughtcrime.securesms.push.TextSecureCommunicationFactory;
import org.thoughtcrime.securesms.recipients.Recipients;
import org.whispersystems.textsecure.api.TextSecureAccountManager;
import org.whispersystems.textsecure.push.ContactTokenDetails;
import org.whispersystems.textsecure.util.DirectoryUtil;
import org.whispersystems.textsecure.util.InvalidNumberException;
import java.util.List;

View File

@ -1,4 +1,23 @@
package org.whispersystems.textsecure.util;
/**
* Copyright (C) 2014 Open Whisper Systems
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.thoughtcrime.securesms.util;
import org.whispersystems.textsecure.util.Base64;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
@ -11,7 +30,7 @@ public class DirectoryUtil {
public static String getDirectoryServerToken(String e164number) {
try {
MessageDigest digest = MessageDigest.getInstance("SHA1");
byte[] token = Util.trim(digest.digest(e164number.getBytes()), 10);
byte[] token = org.whispersystems.textsecure.util.Util.trim(digest.digest(e164number.getBytes()), 10);
return Base64.encodeBytesWithoutPadding(token);
} catch (NoSuchAlgorithmException e) {
throw new AssertionError(e);