Unverified Commit 426e7055 authored by Javier Guerra's avatar Javier Guerra Committed by GitHub

Merge pull request #16 from openconnectivity/develop

Merge develop into master
parents d3c69fdb a36967f1
diff --git a/include/oc_pki.h b/include/oc_pki.h
index acbab8c..c16b512 100644
index acbab8c7..c16b512b 100644
--- a/include/oc_pki.h
+++ b/include/oc_pki.h
@@ -45,6 +45,9 @@ int oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
......@@ -13,10 +13,10 @@ index acbab8c..c16b512 100644
}
#endif
diff --git a/security/oc_pki.c b/security/oc_pki.c
index a9306c2..c9b3b15 100644
index a9306c23..52755576 100644
--- a/security/oc_pki.c
+++ b/security/oc_pki.c
@@ -354,6 +354,16 @@ oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
@@ -354,6 +354,17 @@ oc_pki_add_trust_anchor(size_t device, const unsigned char *cert,
return pki_add_trust_anchor(device, cert, cert_size, OC_CREDUSAGE_TRUSTCA);
}
......@@ -27,6 +27,7 @@ index a9306c2..c9b3b15 100644
+ if (cred)
+ {
+ oc_sec_remove_cred(cred, device);
+ oc_sec_dump_cred(device);
+ }
+}
+
......@@ -34,7 +35,7 @@ index a9306c2..c9b3b15 100644
typedef int dummy_declaration;
#endif /* !OC_PKI */
diff --git a/swig/swig_interfaces/oc_pki.i b/swig/swig_interfaces/oc_pki.i
index 2765e56..9910770 100644
index 2765e562..9910770c 100644
--- a/swig/swig_interfaces/oc_pki.i
+++ b/swig/swig_interfaces/oc_pki.i
@@ -105,4 +105,6 @@ void jni_pki_set_security_profile(size_t device,
......@@ -45,4 +46,4 @@ index 2765e56..9910770 100644
\ No newline at end of file
+%rename (removeCredentialByCredid) oc_pki_remove_credential_by_credid;
+
+%include "oc_pki.h"
\ No newline at end of file
+%include "oc_pki.h"
......@@ -30,7 +30,7 @@ android {
minSdkVersion 21
targetSdkVersion 28
versionCode 13
versionName "2.3.0"
versionName "2.4.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
compileOptions {
......
......@@ -45,7 +45,8 @@ public class GetTrustAnchorUseCase {
List<OcCredential> trustAnchorList = new ArrayList<>();
for (OcCredential cred : credentials.getCredList()) {
if (cred.getCredusage() != null
&& cred.getCredusage() == OcfCredUsage.OC_CREDUSAGE_TRUSTCA) {
&& (cred.getCredusage() == OcfCredUsage.OC_CREDUSAGE_MFGTRUSTCA
|| cred.getCredusage() == OcfCredUsage.OC_CREDUSAGE_TRUSTCA)) {
trustAnchorList.add(cred);
}
}
......
......@@ -44,6 +44,7 @@ public class TrustAnchorAdapter extends RecyclerView.Adapter<TrustAnchorAdapter.
implements View.OnClickListener {
@BindView(R.id.text_cred_id) TextView mCredId;
@BindView(R.id.text_cred_subject) TextView mCredSubject;
@BindView(R.id.text_cred_credusage) TextView mCredUsage;
@BindView(R.id.img_btn_info_cred) ImageButton mInfoButton;
@BindView(R.id.img_btn_delete_cred) ImageButton mDeleteButton;
......@@ -127,8 +128,9 @@ public class TrustAnchorAdapter extends RecyclerView.Adapter<TrustAnchorAdapter.
OcCredential cred = mDataset.get(position);
if (cred != null) {
holder.mCredId.setText(String.format("Credential ID: %d", cred.getCredid()));
holder.mCredId.setText(mContext.getString(R.string.credentials_cardview_credid, cred.getCredid().toString()));
holder.mCredSubject.setText(mContext.getString(R.string.credentials_cardview_subject_uuid, cred.getSubjectuuid()));
holder.mCredUsage.setText(mContext.getString(R.string.credentials_cardview_credusage, cred.getCredusage().getValue()));
}
}
......
......@@ -54,6 +54,11 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/font_size_default" />
<TextView
android:id="@+id/text_cred_credusage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="@dimen/font_size_default" />
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
......
......@@ -53,7 +53,7 @@
<string name="wlan_scan_dialog_password_negative_button_text">Cancelar</string>
<string name="wlan_scan_dialog_connect_to_wifi_message">Conectando a la red Wi-Fi…</string>
<string name="devices_select_oxm_title">Seleccionar OTM</string>
<string name="devices_no_oxm_supported">El dispositivo no soporta ningún OXM.</string>
<string name="devices_no_oxm_supported">El dispositivo no soporta ningún OTM.</string>
<string name="devices_dialog_insert_randompin_title">Introduzca el PIN mostrado por el dispositivo</string>
<string name="devices_dialog_insert_randompin_yes_option">Confirmar</string>
<string name="devices_dialog_insert_randompin_no_option">Cancelar</string>
......@@ -91,7 +91,6 @@
<string name="client_title_no_name">Sin nombre</string>
<string name="client_menu_item_info">Información</string>
<string name="devices_error_offboard_failed">La desvinculación del dispositivo falló</string>
<string name="devices_oxm_man_cert">Certificado de fabricante</string>
<string name="devices_oxm_random_pin">PIN aleatorio</string>
<string name="client_cannot_retrieve_device_info">No se pueden obtener las propiedades del recurso /oic/d</string>
<string name="client_cannot_retrieve_platform_info">No se pueden obtener las propiedades del recurso /oic/p</string>
......@@ -165,6 +164,8 @@
<string name="credentials_cred_error_provision_identity">Error al instalar un certificado de identidad</string>
<string name="credentials_cred_error_provision_role">Error al instalar un certificado de rol</string>
<string name="credentials_cardview_role">ID de rol: %1$s, Autoridad de rol: %2$s</string>
<string name="credentials_cardview_credid">ID Credencial: %1$s</string>
<string name="credentials_cardview_credusage">Uso: %1$s</string>
<string name="devices_dialog_wifi_scan_error">Error escaneando las redes Wi-Fi</string>
<string name="devices_dialog_wifi_easy_setup_connecting">Configurando y conectado el dispositivo mediante Wi-Fi Easy Setup</string>
<string name="devices_dialog_wifi_easy_setup_error">Wi-Fi Easy Setup ha fallado</string>
......
......@@ -103,8 +103,8 @@
<string name="devices_select_oxm_title">Select OTM</string>
<string name="devices_oxm_just_works" translatable="false">Just Works</string>
<string name="devices_oxm_random_pin">Random PIN</string>
<string name="devices_oxm_man_cert">Manufacturer Certificate</string>
<string name="devices_no_oxm_supported">The device does not support any OXM.</string>
<string name="devices_oxm_man_cert" translatable="false">PKI</string>
<string name="devices_no_oxm_supported">The device does not support any OTM.</string>
<string name="devices_dialog_insert_randompin_title">Insert PIN displayed by device</string>
<string name="devices_dialog_insert_randompin_yes_option">Confirm</string>
......@@ -213,6 +213,8 @@
<string name="credentials_cred_error_provision_identity">Error installing identity certificate</string>
<string name="credentials_cred_error_provision_role">Error installing role certificate</string>
<string name="credentials_cardview_subject_uuid" translatable="false">UUID: %1$s</string>
<string name="credentials_cardview_credid">Credential ID: %1$s</string>
<string name="credentials_cardview_credusage">Usage: %1$s</string>
<string name="credentials_cardview_role">Role ID: %1$s, Role Authority: %2$s</string>
<string name="client_title_no_name">Unnamed</string>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment