Commit 4f8d9c26 authored by Arturo Hernandez's avatar Arturo Hernandez

trying write

parent 16ac79ee
......@@ -143,3 +143,5 @@ agetic_mst/
out/
mifare/
.vscode/
\ No newline at end of file
This diff is collapsed.
......@@ -14,11 +14,20 @@ MST_KEY = os.environ.get("MST_KEY", 'cert/server.key')
DEBUG = str2bool(os.environ.get("DEBUG", 'False'))
DEFAULT_KEY_A = os.environ.get("INIT_KEY_A", "FFFFFFFFFFFF") #parsed later
DEFAULT_KEY_B = os.environ.get("INIT_KEY_B", "FFFFFFFFFFFF") #parsed later
INIT_CM_KEY = list(bytes.fromhex(os.environ.get("INIT_CM_KEY", '41 47 45 54 49 43 52 55 4c 45 53 21 31 6f 6e 65')))
INIT_CC_KEY = list(bytes.fromhex(os.environ.get("INIT_CC_KEY", '48 45 4c 4c 4f 20 44 61 72 6b 6e 65 73 73 2e 2e')))
INIT_L2_KEY = list(bytes.fromhex(os.environ.get("INIT_L2_KEY", '4d 79 20 46 72 69 65 6e 64 20 49 20 63 61 6d 65')))
INIT_L3_KEY = list(bytes.fromhex(os.environ.get("INIT_L3_KEY", '74 6f 20 54 61 6c 6b 20 77 69 74 68 20 79 6f 75')))
INIT_CA_KEY = list(bytes.fromhex(os.environ.get("INIT_CA_KEY", '61 67 61 69 6e 2c 20 42 65 63 61 75 73 65 20 61')))
if INIT_CM_KEY == [65, 71, 69, 84, 73, 67, 82, 85, 76, 69, 83, 33, 49, 111, 110, 101]:
import logging
LOGGER = logging.getLogger(__name__)
LOGGER.warn("Usando Inicialización de Ejemplo. modifique sus variables de entorno")
if __name__ == '__main__':
print("configs")
This diff is collapsed.
This diff is collapsed.
......@@ -130,7 +130,7 @@ $(function() {
$("#uiid").text("UUID: " + data.UUIDHex);
$("#reader").text("Lector: " + data.reader);
$("#atr").html("ATR: <a href=\"https://smartcard-atr.apdu.fr/parse?ATR=" + encodeURIComponent(data.ATR) + "\" target=\"_blank\"> " + data.ATR + "</a>");
if (data.ATR_match.length){
if (data.ATR_match.length || data.ATR_possible.length){
$("#atr").append("<h5>Tipo de tarjeta</h5>");
data.ATR_match.forEach(function(e,i){
$("#atr").append((i==0?"<strong class=\"alert-success\">":"") + e + (i==0?"</strong>":"") + "<br/>");
......@@ -145,7 +145,9 @@ $(function() {
$("#atr").append("<h5 class=\"alert-danger\">Tarjeta desconocida</h5>");
}
$("#mensaje").removeClass('alert-danger').addClass('alert-success');
$("#mensaje").text(data.message);
if (data.data){
$("#mensaje").text("Block " + data.data.block + " : " + (data.data.isValue ? data.data.value : data.data.string));
}else $("#mensaje").text(data.message);
}else{
$("#mensaje").removeClass('alert-success').addClass('alert-danger');
$("#mensaje").text(data.error || data.message || "Error al recabar respuesta " + data.toString());
......@@ -185,7 +187,7 @@ $(function() {
$("#uiid").text("UUID: " + data.UUIDHex);
$("#reader").text("Lector: " + data.reader);
$("#atr").html("ATR: <a href=\"https://smartcard-atr.apdu.fr/parse?ATR=" + encodeURIComponent(data.ATR) + "\" target=\"_blank\"> " + data.ATR + "</a>");
if (data.ATR_match && data.ATR_match.length){
if (data.ATR_possible && data.ATR_possible.length || data.ATR_match && data.ATR_match.length){
$("#atr").append("<h5>Tipo de tarjeta</h5>");
data.ATR_match.forEach(function(e,i){
$("#atr").append((i==0?"<strong class=\"alert-success\">":"") + e + (i==0?"</strong>":"") + "<br/>");
......
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