I'm sending below command to javacard but I'm getting this error
Env: android app running on galaxy s3 over nfc
6985 Conditions of use not satisfied
It would be nice if you let me know what would be cause of this error.
byte[] APDU_Command = new byte[]{
(byte)0x80,//CLA
(byte)0xD0,//INS
(byte)0x01,//P1
(byte)0x00,//P2
//Length
(byte)0x21,//Lc
//id
(byte)31,
(byte)32,
(byte)33,
(byte)34,
//number
(byte)33,
(byte)35,
(byte)31,
(byte)36,
(byte)39,
(byte)38,
(byte)30,
(byte)35,
(byte)37,
(byte)37,
(byte)34,
(byte)30,
(byte)31,
(byte)37,
(byte)33,
//Name
(byte)50,
(byte)72,
(byte)65,
(byte)76,
(byte)61,
(byte)73,
(byte)54,
(byte)65,
(byte)73,
(byte)74,
(byte)43,
(byte)61,
(byte)72,
(byte)64
};
Thanks in advance,
Related
I'm using NodeRSA to verify the signature of a given data thanks to a public key.
When I'm initiating NodeRSA, an error is thrown, which comes from a module used by NodeRSA : node-asn1.
The error is Expected 0x30: got 0x37.
I dove into the code and identified the exact line where the error occurred, but as I'm a newbie in crypto, I couldn't really find any solution.
var reader = new ber.Reader(buffer);
reader.readSequence();
var header = new ber.Reader(reader.readString(0x30, true));
I know some errors are expecting 0x2, which is the start of text. But I can't understand why we are expecting a 0 (0x30) and we've got a 7 (0x37) instead.
Would you have any solutions, or even ideas that I could dive into ?
I wrote a node.js script that connects to an external device via an USB serial port. The external device uses a chip from FTDI that converts to and from USB signals. I programmed basic device information like manufacturer, description, serial number etc. to that chip with FT_Prog, assuming this information is provided when I read the port information in my node.js script (using serialport package).
However it seems that I cannot retrieve that information on my Windows system. When I read the serial port information I am connected to, the manufacturer always is FTDI, description is undefined. But when using a Linux system, that information is available.
This seems to be the same topic. But as far as I understand I should be able to get the information as soon as I programmed the chip with FT_Prog. But it's still not working.
So why is it, that I cannot retrieve this information on Windows, but on Linux?
Thanks in advance!
EDIT
The code I am using:
'use strict';
const serialPort = require('serialport');
searchFscPort();
function searchFscPort() {
serialPort.list().then(ports => {
for(let i = 0; i < ports.length; i++) {
if(ports[i].manufacturer == 'FTDI' || ports[i].manufacturer == 'ME') {
console.log('Path: ', ports[i].path);
console.log('Manufacturer: ', ports[i].manufacturer);
console.log('SN: ', ports[i].serialNumber);
console.log('lID: ', ports[i].locationId);
console.log('pID: ', ports[i].productId);
console.log('vID: ', ports[i].vendorId);
console.log('pnpID: ', ports[i].pnpId);
return;
}
}
});
}
Result on Windows:
path: COM4
manufacturer: FTDI
SN: 110
lID: undefined
pID: 6015
vID: 0403
pnpID: FTDIBUS\VID_0403+PID_6015+110A\0000
Result on Linux:
path: /dev/ttyUSB0
manufacturer: ME
SN: 110
lID: undefined
pID: 6015
vID: 0403
pnpID: usb-ME_FSC1_7_110-if00-port0
This is what I have programmed into the chip:
By the way, there seems to be no node.js property to get the "Manufacturer Desc"?
I am actually connecting my laptop and arduino using FPVDrone 3DR Radio Telemetry. My connection is
ARDUINO tx- FPV Air module rx
ARDUINO rx- FPV Air module tx
ARDUINO 5v- FPV Air module 5v
ARDUINO GND- FPV Air module GND
while my FPV ground module is connected to my laptop. I have an app running using node JS with the following script
const SerialPort = require('serialport');
const Readline = SerialPort.parsers.Readline;
const port = new SerialPort('COM3');
port.write('hello');
and my arduino code is
void setup() {
Serial.begin(57600);
}
void loop() {
if (Serial.available()) {
Serial.print((char) Serial.read());
delay(10);
}
}
i'm pretty sure they are communicating because my arduino is receiving some output, however the output is some characters i dont know,
arduino output
can someone please tell me what I should do so that i can receive the string "hello" to my arduino?
Try setting the baudrate in the node.js script
const port = new SerialPort(path, { baudRate: 57600 })
characters get messed up is the sending and receiving baudrates are different.
Are sure that the characters sent to the Arduino are ASCII code?
If you are sending integers and they are below 0x30, then they are non-printable characters and you will see gibberish.
Make sure that you send an ASCII symbol or use/make a terminal that can show the raw integers.
I'm trying to use LibvlcSharp on a linux installation (Ubuntu 18.04). I'm following all the instructions, including this one Getting started on LibVLCSharp.Gtk for Linux but my application always crash. It's working perfectly on windows, because there we can add VideoLAN.LibVLC.Windows package, but I couldn't find someting similar for Linux.
My code:
static void Main(string[] args)
{
// Record in a file "record.ts" located in the bin folder next to the app
var currentDirectory = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
var destination = Path.Combine(currentDirectory, "record.ts");
// Load native libvlc library
Core.Initialize();
using (var libvlc = new LibVLC())
//var libvlc = "/usr/lib/x86_64-linux-gnu/";
using (var mediaPlayer = new MediaPlayer(libvlc))
{
// Redirect log output to the console
libvlc.Log += (sender, e) => Console.WriteLine($"[{e.Level}] {e.Module}:{e.Message}");
// Create new media with HLS link
var urlRadio = "http://transamerica.crossradio.com.br:9126/live.mp3";
var media = new Media(libvlc, urlRadio, FromType.FromLocation);
// Define stream output options.
// In this case stream to a file with the given path and play locally the stream while streaming it.
media.AddOption(":sout=#file{dst=" + destination + "}");
media.AddOption(":sout-keep");
// Start recording
mediaPlayer.Play(media);
Console.WriteLine($"Recording in {destination}");
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}
The error message:
Unhandled Exception: LibVLCSharp.Shared.VLCException: Failed to perform instanciation on the native side. Make sure you installed the correct VideoLAN.LibVLC.[YourPlatform] package in your platform specific project
at LibVLCSharp.Shared.Internal..ctor(Func1 create, Action1 release)
at RadioRecorderLibVlcSharp.Program.Main(String[] args) in /media/RadioRecorderLibVlcSharp/Program.cs:line 19
Anyone can help me?
thanks
Can you try apt-get install vlc? That seems to help getting all the required plugins/deps on your system (though it will pull vlc 2.x from the official ubuntu rep probably).
I have two Arduino unos flashed with the standard StandardFirmata and i'm trying the multi board demo with a simple node project (johnny-five npm package). Both arduinos work when I try them separately. with the following code:
var five = require("johnny-five");
var boardOne = new five.Board({ id: "A", port: "/dev/cu.usbmodem1d1141" });
boardOne.on("ready", function(){
var led = new five.Led({
pin: 13,
board: this
});
led.on();
});
node index.js
1418288836782 Connected /dev/cu.usbmodem1d1141
1418288836784 Repl Initialized
>>
When trying the multi board example I get:
Device or Firmware Error A timeout occurred while connecting to the Board.
Please check that you've properly flashed the board with the correct firmware.
var five = require("johnny-five");
var ports = [
{ id: "A", port: "/dev/cu.usbmodem1d1141" },
{ id: "B", port: "/dev/cu.usbmodem1d1131" }
];
new five.Boards(ports).on("ready", function(){
var led = new five.Led({
pin: 13,
board: this[0]
});
led.on();
});
Update #1:
Out of curiosity I tried to switch around the usb cables and got some different results:
1) Only one arduino seems to connect:
1418318698635 Device(s) /dev/cu.usbmodem1a1231,/dev/cu.usbmodem1a1241
1418318698642 Device(s) /dev/cu.usbmodem1a1241
1418318701849 Connected /dev/cu.usbmodem1a1231
1418318701850 Board ID: A
or 2) I get an error:
.../johnny-five-master/node_modules/firmata/lib/firmata.js:246
board.pins[pin].analogChannel = currentValue;
^
TypeError: Cannot set property 'analogChannel' of undefined
at Object.SYSEX_RESPONSE.(anonymous function) [as 106]
(.../johnny-five-master/node_modules/firmata/lib/firmata.js:246:35)
Update #2:
I did the above test with cylon.js and got the same results. Still no clue how to fix this :(
One arduino works fine, multiple do nothing. (Maybe an osx related problem?)
Update #3:
I added some logs in the johnny-five code and it's definitely a connection problem(I think!?). The second Arduino never responds. I switched the order of the arduinos and get the same result (first one connects, the other fails to respond). The connection is asynchronous, so maybe it gets blocked somewhere. The lights on both arduinos definitely show some action is going on.
node index.js
err: undefined --- type: connect --- io: /dev/tty.usbmodem1d1111
err: undefined --- type: connect --- io: /dev/tty.usbmodem1d1121
err: undefined --- type: ready --- io: /dev/tty.usbmodem1d1111
1418467187527 Connected /dev/tty.usbmodem1d1111
1418467187527 Board ID: A
1418467284327 Device or Firmware Error A timeout occurred while connecting to the Board.
Please check that you've properly flashed the board with the correct firmware.
Thanks to #izar for posting this and then bringing the question to us in the Johnny-Five gitter channel. From there, Divan Visagie (from Johnny-Five core team) worked to triage the bug and was able to confirm via reproduction. This revealed a bug in Firmata.js, where the options passed to Serialport were being extended by that class. Since the defaults object was reused and Object.assign is not a "deep" operation, the changes were being made to a reference, not a copy. The result was that the second initialization was getting a set of "defaults" that were loaded up with the first instance's own data. The issue was fixed by changing Firmata to use fresh defaults for every instance. Here's the patch