-scp option not working properly with gp.exe - javacard

I have two commands that expected to behave the same:
gp -key-enc 404142434445464748494a4b4c4d4e4f -key-kek 404142434445464748494a4b4c4d4e4f -key-mac 404142434445464748494a4b4c4d4e4f -mode mac keyid 0 keyver 0 -sdaid A000000151000000 -debug -list
gp -key-enc 404142434445464748494a4b4c4d4e4f -key-kek 404142434445464748494a4b4c4d4e4f -key-mac 404142434445464748494a4b4c4d4e4f -mode mac -scp 2 keyid 0 keyver 0 -sdaid A000000151000000 -debug -list
The only difference is the addition of "-scp 2" in the second command.
The card clearly supports scp 02.
The options are explicitly stated.
The first command is okay in external authentication.
The second command is not okay in external authentication (0x6982).
I am using GlobalPlatformPro v0.3.9 from GitHub! that supports SCP03.
It should support SCP01, 02 and 03.
I need to understand what could be the issue I am encountering right now.
I tried some proprietary tools and it works perfectly but I need to make it work here in GlobalPlatformPro.
Thanks

Related

Unable to use PTP management client (pmc) to view GRANDMASTER_SETTINGS_NP (LinuxPTP)

I am following the following tutorial: https://tsn.readthedocs.io/timesync.html. My setup is a Ubuntu PC acting as Grandmaster, a Ubuntu laptop acting as a slave, and a switch in between them.
This doc says to update the GRANDMASTER_SETTINGS_NP message using pmc. I want to revert to the default settings.
On the man page, it doesn't seem there's an option to undo what I've just done. I understand by looking through the IEEE 1588 spec that each of the options like clockAccuracy and ptpTimescale don't necessarily have default values, so I'd just like to revert what I've done. The command I used was:
sudo pmc -u -b 0 -t 1 "SET GRANDMASTER_SETTINGS_NP clockClass 248 \
clockAccuracy 0xfe offsetScaledLogVariance 0xffff \
currentUtcOffset 37 leap61 0 leap59 0 currentUtcOffsetValid 1 \
ptpTimescale 1 timeTraceable 1 frequencyTraceable 0 \
timeSource 0xa0"
Also, I'm trying to view the GRANDMASTER_SETTINGS_NP values. I'm using sudo pmc -u -b 0 "GET GRANDMASTER_SETTINGS_NP", and other people are saying I should receive a message that shows the current values, but all I see is:
sending: GET GRANDMASTER_SETTINGS_NP
with nothing after it.
Can anyone help or point me to a resource that explains how to use pmc well, other than the man page (https://linux.die.net/man/8/pmc)

Sending SNMP2 trap message from Linux command lne

Folks,
I need to use this command (snmptrap) from Linux command line to send my custom message to a trap listener. I need to send the same message in both v1 and v2c depending on user settings.
Here is what I found.
For v1:
snmptrap -v 1 -c Tas hostname 1.3.6.1.4.1.2.3 "" 6 3 1234 s s "This is a test"
The above command works, I see the following message in my listener.
Display of SNMPv1 trap:
community: Tas
enterprise oid: 1.3.6.1.4.1.2.3
..... ibmAgents
agentAddress: hostname
generic-trap: enterpriseSpecific ('00000006'h)
specific-trap: 3 ('00000003'h)
time-stamp: 1234 - 12.34 seconds
varBind oid: OBJECT_IDENTIFIER 1.3.6.1.6
name: snmpV2
value: OCTET_STRING This is a test <- Here is my message.
My listener is a basically an AIX system, running the following command.
clsnmp -c public TRAP
For v2c: I am issuing this command.
snmptrap -v 2c -c "Tas" hostname '1234' 1.3.6.1.4.1.2.3 s s "This is a Test"
The command does not give me any error. But on the listener I see this.
Display of SNMPv2 trap with SNMPV2C security
community: Tas
The message "This is a Test" is not shown.
I am not familiar with snmptrap command - know very little about the protocol also. I have googled the command. My questions...
Is there anything wrong with the v2c command?
Is there anything wrong with my listener command? Let me know if I should something else. I can set up a Linux listener too.
Any suggestion is most welcome. I want to keep it simple - sending a custom message over snmp to a host, v1 and v2c and set up a listener to verify that my commands are working.
Thanks a lot
Tas
The command should look like this:
snmptrap -v 2c -c "Tas" 127.0.0.1 0 1.3.6.1.4.1.2.3 1.3.6.1.6.1.4.1.2.3.1.1.1.1.1 s "This is a Test"
Please note that varbind (OCTET STRING in this case) which is part of your SNMP trap PDU should also have an OID assigned. I've just used random OID for this varbind: 1.3.6.1.6.1.4.1.2.3.1.1.1.1.1
Please also note that you should use proper OIDs based on trap definitions from MIB file(s).
I'd suggest using enterprise class SNMP tools to send out SNMP traps like NetDecision Trap Simulator. This tool sends out traps in full accordance with SNMP standards and based on MIB file definitions:

Using gnu screen to access serial port

I am trying to access a device which is attached to a USB-serial port. The settings are 57600 baud, 8 bit, 1 stop bit, no parity. The device outputs a status line every second and accepts typed commands.
I would like to use GNU screen to initiate 2 way communications, so I am using this command:
screen /dev/ttyS2 57600,cs8
However I just get a blank screen, nothing received from the device.
The communication is fine using teraterm, and I can also do this
stty -F /dev/ttyS2 57600 cs8
cat /dev/ttyS2
to see the status output from the device.
I've tried various combinations of ixon, ixoff, crtscts, and clocal but nothing makes any difference.
How can I determine what the correct command should be?
I am using Cygwin on Windows 10.
I faced the same issue with gnu-screen, I started using plink.exe instead from the PuTTY suite. It's not optimal, but it does the job. In my case serial is just for recovery, not for everyday usage.
Start PuTTY, create a profile with your serial connection.
Name and save the connection.
From cygwin, run: '/cygdrive/c/Program\ Files\ (x86)/PuTTY/plink.exe -load SerialProfile'

TBOOT: DMAR not found

I have also posted this on the tboot-devel#lists.sourceforge.net mailing list, but I descided to post here as well to get more exposure to this issue.
I'm trying to get tboot to work, but I'm getting nowhere fast.
I've installed tboot (1.7.4-0ubuntu1 via apt-get) on xubuntu 32-bit (kernel 3.11.0-18-generic) on my machine (Lenovo Thinkpad Helix 3701).
Then I put the 3rd_gen_i5_i7_SINIT_67.BIN file in /boot/ directory (got it form intel web page).
I edited relevant lines in /boot/grub/grub.cfg to look like this:
submenu "tboot 1.7.4" {
menuentry 'Ubuntu GNU/Linux, with tboot 1.7.4 and Linux 3.11.0-18-generic' --class ubuntu --class gnu-linux --class gnu --class os --class tboot {
insmod part_msdos
insmod ext2
set root='hd1,msdos1'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd1,msdos1 --hint-efi=hd1,msdos1 --hint-baremetal=ahci1,msdos1 1ffcf898-aa43-4729-873a-f17bd4342ca0
else
search --no-floppy --fs-uuid --set=root 1ffcf898-aa43-4729-873a-f17bd4342ca0
fi
echo 'Loading tboot 1.7.4 ...'
multiboot /tboot.gz /tboot.gz logging=serial,vga,memory vga_delay=5
echo 'Loading Linux 3.11.0-18-generic ...'
module /vmlinuz-3.11.0-18-generic /vmlinuz-3.11.0-18-generic root=UUID=abda87ef-d7e7-4411-a3cc-49817ad7b692 ro quiet splash intel_iommu=on
echo 'Loading initial ramdisk ...'
module /initrd.img-3.11.0-18-generic /initrd.img-3.11.0-18-generic
echo 'Loading ACM module ...'
module /3rd_gen_i5_i7_SINIT_67.BIN
}
After this i reboot and select "tboot ..." in grub menu.
After displaying "Executing GETSEC[SENTER]..." the machine reboots and on the next attempt I get the following error:
TXT.ERRORCODE: 0xC00010c1
AC module error: acm_type=0x1, progress=0x0c, error=0x4
I've decoded the error code as per SINIT_Errors.pdf from the intel web page:
1 - Valid
1 - External software
000000 - Reserved
00000000 - Minor Error code
0 - Sotware source
00100 - Major error code
001100 - Class code
0001 - Module type
Acording to the pdf this indcates: Class ACPI Check, DMAR not found.
I have really no idea where to go from here, what do you guys suggest?
I would have included more logs in this post, but I only have them in JPEGs since I had to take pictures of the screen to save the output. If you think it will help I will attempt to transcribe them to text and post a link to pastebin ?
Thank you in advance!
The DMAR tables are initialized by the firmware.
Check that VT-d is enabled in your firmware
Check whether DMAR is present in your ACPI tables
sudo ls -al /sys/firmware/acpi/tables
If the DMAR table is missing this indicates an issue with your firmware

RealVNC server Enterprise 5.0: How to manage parameters without vncconfig?

EDIT: Already posted in serverfault forum but no answers after 2 months so I try in stackoverflow...
https://serverfault.com/questions/558300/realvnc-server-enterprise-5-0-how-to-manage-parameter-as-there-is-no-more-vncco
I just would like to know with new VNC version 5.0, how we can access and change the running parameters by command line ?
Indeed using RealVNC 4.x, it was possible using vncconfig, for example:
%> vncconfig -set RandR=1600x1200,1280x1024
%> vncconfig -get RandR
1600x1200,1280x1024
%> xrandr
SZ: Pixels Physical Refresh
*0 1920 x 1200 ( 488mm x 305mm ) *0
1 1600 x 1200 ( 406mm x 305mm ) 0
2 1280 x 1024 ( 325mm x 260mm ) 0
But since 5.0 there is no more vncconfig executable... as explained into ReleaseNote:
"5.0.0, released 7th June 2012 VNC Server no longer requires a separate vncconfig utility in order to permit configuration and operations such as file transfer and copy and paste text. "
But even if we can still change RandR parameter "manually" through graphic utility called "vncserverui" -> Options -> Expert -> RandR but it seems, there is no more possibility to change it through command line like it was in 4.x with vncconfig !?!
However I tried to use new executables like that but without any success :
%> vncserverui -set RandR=1024x768
VNC(R) Server 5.0.5 (r106461)
Built on Mar 4 2013 12:57:36
Copyright (C) 2002-2013 RealVNC Ltd.
This program is not intended to be run directly.
The server starts it as needed.
or
%> vncserver-virtuald RandR=1024x768
Unknown parameter: RandR=1024x768
VNC(R) Virtual Server Daemon 5.0.5 (r106461)
Built on Mar 4 2013 12:57:39
So How can we do ?
Thanks,
Cyril
Well after months of errancy, I answer to myself...
because I finally have solutions.
In fact, in v5.0 it seems there was no more possibility to manage VNC variables/parameters directly from command line :-(
But since RealVNC v5.1 there is an unofficial way to do that using "Xvnc -setconfig" in the following way:
echo RandR=1920x1200,1600x1200,1280x1024 | Xvnc -setconfig -
So for csh an interesting alias to resize session could be:
alias vnc-resize 'echo RandR=1920x1200,1600x1200,1280x1024 | Xvnc -setconfig -; xrandr; echo -n
"Please enter the wanted resolution:"; xrandr -s $<'
Another way is to update "~/.vnc/config.d/Xvnc" file and then reload server:
Xvnc -reload

Resources