Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 84fcd18e authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 7de4bd9b: Merge change 6045 into donut

Merge commit '7de4bd9b'

* commit '7de4bd9b':
  Remove the null-termination for Java string compatibility.
parents 133ec72f 7de4bd9b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -142,7 +142,7 @@ static void do_get_state(LPC_MARSHAL *cmd, LPC_MARSHAL *reply)
static void do_listkeys(LPC_MARSHAL *cmd, LPC_MARSHAL *reply)
static void do_listkeys(LPC_MARSHAL *cmd, LPC_MARSHAL *reply)
{
{
    reply->retcode = list_keys((const char*)cmd->data, (char*)reply->data);
    reply->retcode = list_keys((const char*)cmd->data, (char*)reply->data);
    if (!reply->retcode) reply->len = strlen((char*)reply->data) + 1;
    if (!reply->retcode) reply->len = strlen((char*)reply->data);
}
}


// args of get():
// args of get():
+1 −1
Original line number Original line Diff line number Diff line
@@ -51,7 +51,7 @@ public class CertTool {
    private static final String USER_CERTIFICATE = "USRCERT";
    private static final String USER_CERTIFICATE = "USRCERT";
    private static final String USER_KEY = "USRKEY";
    private static final String USER_KEY = "USRKEY";


    private static final String KEYNAME_DELIMITER = " ";
    private static final String KEYNAME_DELIMITER = "_";
    private static final Keystore keystore = Keystore.getInstance();
    private static final Keystore keystore = Keystore.getInstance();


    private native String generateCertificateRequest(int bits, String subject);
    private native String generateCertificateRequest(int bits, String subject);
+11 −3
Original line number Original line Diff line number Diff line
@@ -25,6 +25,12 @@ public abstract class Keystore {
    private static final String TAG = "Keystore";
    private static final String TAG = "Keystore";
    private static final String[] NOTFOUND = new String[0];
    private static final String[] NOTFOUND = new String[0];


    // Keystore States
    public static final int BOOTUP = 0;
    public static final int UNINITIALIZED = 1;
    public static final int LOCKED = 2;
    public static final int UNLOCKED = 3;

    /**
    /**
     */
     */
    public static Keystore getInstance() {
    public static Keystore getInstance() {
@@ -195,9 +201,11 @@ public abstract class Keystore {
        public String[] listKeys(String namespace) {
        public String[] listKeys(String namespace) {
            Reply result = mServiceCommand.execute(ServiceCommand.LIST_KEYS,
            Reply result = mServiceCommand.execute(ServiceCommand.LIST_KEYS,
                    namespace);
                    namespace);
            return (result != null) ? ((result.returnCode != 0) ? NOTFOUND :
            if ((result == null) || (result.returnCode != 0) ||
                    new String(result.data, 0, result.len).split("\\s+"))
                    (result.len == 0)) {
                    : NOTFOUND;
                return NOTFOUND;
            }
            return new String(result.data, 0, result.len).split("\\s+");
        }
        }


        @Override
        @Override