Skip to content

Instantly share code, notes, and snippets.

View Jakuje's full-sized avatar
🦌
oh deer!

Jakub Jelen Jakuje

🦌
oh deer!
View GitHub Profile
@Jakuje
Jakuje / gpx2navit.xsl
Last active August 29, 2015 14:17
Simple transformation for GPX files into files readable by Navit mobile navigation (with specialization for Geocaching)
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:g="http://www.topografix.com/GPX/1/0">
<xsl:output method="text"/>
<xsl:template match="g:gpx">
<xsl:for-each select="g:wpt">
<xsl:choose>
<xsl:when test="g:type = 'Waypoint|Parking Area'">
<xsl:text>type=poi_car_parking label="</xsl:text>
</xsl:when>
<xsl:when test="starts-with(g:type, 'Geocache')">
<xsl:text>type=poi_attraction label="</xsl:text>
@Jakuje
Jakuje / update_gpx.sh
Created May 20, 2015 20:50
Using xsl transfrom gpx to txt file used by Navit on my webOS phone
#!/bin/bash
#FILENAME="9897043"
FILENAME=$1
#wget -O ${FILENAME}.gpx "http://www.geocaching.com/pocket/downloadpq.ashx?g=fba142aa-e661-4533-ad6d-3220b900241c&src=web"
[ -f "${FILENAME}.zip" ] && unzip "${FILENAME}.zip"
xsltproc ~/.local/bin/gpx2navit.xsl ${FILENAME}{,-wpts}.gpx > ${FILENAME}_nav.txt
cat ${FILENAME}_nav.txt | novaterm put file:///media/internal/appdata/org.webosinternals.navit/maps/cache.txt
@Jakuje
Jakuje / stylish.geocaching.css
Created June 23, 2016 06:46
geocaching.com/pocket move button
@namespace url(http://www.w3.org/1999/xhtml);
@-moz-document domain("www.geocaching.com") {
#ctl00_ContentBody_btnSubmit {
position:absolute;
top:10px;
left:10px
}
}
isOldGeocachingDomain = isGeocachingDomain
function isGeocachingDomain(url) {
if (isOldGeocachingDomain(url)
|| url == "project-gc.com"
|| url == "www.project-gc.com") {
return true;
}
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] pkcs11-global.c:646:C_WaitForSlotEvent: C_WaitForSlotEvent(block=1)
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] slot.c:488:slot_find_changed: called
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] slot.c:359:card_detect_all: Detect all cards
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] slot.c:224:card_detect: OMNIKEY AG CardMan 3121 00 00: Detecting smart card
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] sc.c:271:sc_detect_card_presence: called
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] reader-pcsc.c:397:pcsc_detect_card_presence: called
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] reader-pcsc.c:303:refresh_attributes: OMNIKEY AG CardMan 3121 00 00 check
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] reader-pcsc.c:323:refresh_attributes: returning with: 0 (Success)
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] reader-pcsc.c:402:pcsc_detect_card_presence: returning with: 0 (Success)
0x7f8a6742e700 09:39:20.355 [opensc-pkcs11] sc.c:276:sc_detect_card_presence: returning with: 0
0x7f1953507700 19:15:57.751 [opensc-pkcs11] ctx.c:790:sc_context_create: ===================================
0x7f1953507700 19:15:57.751 [opensc-pkcs11] ctx.c:791:sc_context_create: opensc version: 0.16.0
0x7f1953507700 19:15:57.752 [opensc-pkcs11] reader-pcsc.c:754:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=1 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7f1953507700 19:15:57.752 [opensc-pkcs11] reader-pcsc.c:1154:pcsc_detect_readers: called
0x7f1953507700 19:15:57.752 [opensc-pkcs11] reader-pcsc.c:1168:pcsc_detect_readers: Probing PC/SC readers
0x7f1953507700 19:15:57.752 [opensc-pkcs11] reader-pcsc.c:1196:pcsc_detect_readers: Establish PC/SC context
0x7f1953507700 19:15:57.765 [opensc-pkcs11] reader-pcsc.c:1243:pcsc_detect_readers: Found new PC/SC reader 'OMNIKEY AG CardMan 3121 00 00'
0x7f1953507700 19:15:57.765 [opensc-pkcs11] reader-pcsc.c:303:refresh_attributes: OMNIKEY AG CardMan 3121 00 00 check
0x7f1953507700 19:15:57.765 [opensc-pkcs11] reader-pcsc
0x7fbb8f041700 09:52:11.092 [opensc-tool] ctx.c:664:process_config_file: scconf_parse failed: Unable to open "/usr/local/etc/opensc.conf": No such file or directory
0x7fbb8f041700 09:52:11.092 [opensc-tool] ctx.c:789:sc_context_create: ===================================
0x7fbb8f041700 09:52:11.092 [opensc-tool] ctx.c:790:sc_context_create: opensc version: 0.16.0
0x7fbb8f041700 09:52:11.092 [opensc-tool] reader-pcsc.c:754:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=1 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
0x7fbb8f041700 09:52:11.093 [opensc-tool] reader-pcsc.c:1154:pcsc_detect_readers: called
0x7fbb8f041700 09:52:11.093 [opensc-tool] reader-pcsc.c:1168:pcsc_detect_readers: Probing PC/SC readers
0x7fbb8f041700 09:52:11.093 [opensc-tool] reader-pcsc.c:1196:pcsc_detect_readers: Establish PC/SC context
0x7fbb8f041700 09:52:11.102 [opensc-tool] reader-pcsc.c:1243:pcsc_detect_readers: Found new PC/SC reader 'OMNIKEY AG CardMan 3121 00 00'
0x7fbb8f041700 09:52:1
@Jakuje
Jakuje / README.md
Last active December 1, 2023 17:36
OpenSC test Sign, Verify, Encipher and Decipher from commandline with OpenSSL CLI
export PIN=111111
export SIGN_KEY=11
export ENC_KEY=55

Sign/Verify using private key/certificate

  • Create a data to sign

    echo "data to sign (max 100 bytes)" > data
    
[opensc-pkcs11] ctx.c:790:sc_context_create: ===================================
[opensc-pkcs11] ctx.c:791:sc_context_create: opensc version: 0.16.0
[opensc-pkcs11] reader-pcsc.c:754:pcsc_init: PC/SC options: connect_exclusive=0 disconnect_action=1 transaction_end_action=0 reconnect_action=0 enable_pinpad=1 enable_pace=1
[opensc-pkcs11] reader-pcsc.c:1154:pcsc_detect_readers: called
[opensc-pkcs11] reader-pcsc.c:1168:pcsc_detect_readers: Probing PC/SC readers
[opensc-pkcs11] reader-pcsc.c:1196:pcsc_detect_readers: Establish PC/SC context
[opensc-pkcs11] reader-pcsc.c:1243:pcsc_detect_readers: Found new PC/SC reader 'OMNIKEY AG CardMan 3021 00 00'
[opensc-pkcs11] reader-pcsc.c:303:refresh_attributes: OMNIKEY AG CardMan 3021 00 00 check
[opensc-pkcs11] reader-pcsc.c:331:refresh_attributes: current state: 0x00080122
[opensc-pkcs11] reader-pcsc.c:332:refresh_attributes: previous state: 0x00000000
diff --git a/ssh-rsa.c b/ssh-rsa.c
index 6e2bba0d..b82045e2 100644
--- a/ssh-rsa.c
+++ b/ssh-rsa.c
@@ -232,6 +232,7 @@ ssh_rsa_verify(const struct sshkey *key,
ret = SSH_ERR_KEY_TYPE_MISMATCH;
goto out;
}
+ debug("Verifying signature with ktype=%s and hash_alg=%d", ktype, hash_alg);
if (sshbuf_get_string(b, &sigblob, &len) != 0) {