mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-14 11:49:04 +01:00
Encrypt and save crash reports, send them the next time TorPlugin start
Will currently fail at runtime; requires a public key and a server onion.
This commit is contained in:
@@ -3,6 +3,7 @@ package org.briarproject.api.crypto;
|
||||
import org.briarproject.api.TransportId;
|
||||
import org.briarproject.api.transport.TransportKeys;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.security.GeneralSecurityException;
|
||||
import java.security.SecureRandom;
|
||||
|
||||
@@ -156,4 +157,9 @@ public interface CryptoComponent {
|
||||
* authenticated (for example, if the password is wrong).
|
||||
*/
|
||||
byte[] decryptWithPassword(byte[] ciphertext, String password);
|
||||
|
||||
/**
|
||||
* Encrypts the given plaintext to the given public key.
|
||||
*/
|
||||
String encryptToKey(byte[] publicKey, byte[] plaintext);
|
||||
}
|
||||
|
||||
10
briar-api/src/org/briarproject/api/reporting/DevConfig.java
Normal file
10
briar-api/src/org/briarproject/api/reporting/DevConfig.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package org.briarproject.api.reporting;
|
||||
|
||||
public interface DevConfig {
|
||||
|
||||
byte[] getDevPublicKey();
|
||||
|
||||
String getDevOnionAddress();
|
||||
|
||||
int getDevReportPort();
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package org.briarproject.api.reporting;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
|
||||
/**
|
||||
* A task for reporting back to the developers.
|
||||
*/
|
||||
public interface DevReporter {
|
||||
|
||||
/**
|
||||
* Store a crash report encrypted on-disk to be sent later.
|
||||
*
|
||||
* @param crashReportDir the directory where crash reports are stored.
|
||||
* @param crashReport the crash report in the form expected by the server.
|
||||
* @throws FileNotFoundException if the report could not be written.
|
||||
*/
|
||||
void encryptCrashReportToFile(File crashReportDir, String crashReport)
|
||||
throws FileNotFoundException;
|
||||
|
||||
/**
|
||||
* Send crash reports previously stored on-disk.
|
||||
*
|
||||
* @param crashReportDir the directory where crash reports are stored.
|
||||
* @param socksPort the SOCKS port of a Tor client.
|
||||
*/
|
||||
void sendCrashReports(File crashReportDir, int socksPort);
|
||||
}
|
||||
Reference in New Issue
Block a user