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 / gist:4ec5e9f254261dad2c030159ac01db94
Last active March 25, 2020 21:51
cardos raw rsa fail
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] mechanism.c:250:sc_pkcs11_sign_init: called
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] mechanism.c:255:sc_pkcs11_sign_init: mechanism 0x3, key-type 0x0
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] misc.c:268:session_start_operation: called
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] misc.c:269:session_start_operation: Session 0x100bdb0, type 1
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] mechanism.c:376:sc_pkcs11_signature_init: called
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] mechanism.c:430:sc_pkcs11_signature_init: returning with: 0 (Success)
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] mechanism.c:283:sc_pkcs11_sign_init: returning with: 0 (Success)
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] pkcs11-object.c:679:C_SignInit: C_SignInit() = CKR_OK
P:53015; T:0x140670088165184 22:42:32.449 [opensc-pkcs11] framework-pkcs15.c:3676:pkcs15_prkey_get_attribute
<?php
//============================================================+
// File name : example_0XX.php
// Begin : 2020-04-10
// Last Update : 2020-04-10
//
// Description : Example 0XX for TCPDF class
// Transactions bug
//
// Author: Jakub Jelen
diff --git a/src/libopensc/asn1.c b/src/libopensc/asn1.c
index ad841934..9a077d3a 100644
--- a/src/libopensc/asn1.c
+++ b/src/libopensc/asn1.c
@@ -1506,7 +1506,7 @@ static int asn1_decode_entry(sc_context_t *ctx,struct sc_asn1_entry *entry,
case SC_ASN1_INTEGER:
case SC_ASN1_ENUMERATED:
if (parm != NULL) {
- r = sc_asn1_decode_integer(obj, objlen, (int *) entry->parm, 0);
+ r = sc_asn1_decode_integer(obj, objlen, (int *)entry->parm, 0);
@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