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
diff --git a/src/libopensc/card-idprime.c b/src/libopensc/card-idprime.c
index 7f71b789..57fe8b8f 100644
--- a/src/libopensc/card-idprime.c
+++ b/src/libopensc/card-idprime.c
@@ -188,7 +188,7 @@ static int idprime_process_index(sc_card_t *card, idprime_private_data_t *priv,
&& start[7] == 0x30) {
new_object.fd++;
/* The key reference is one bigger than the value found here for some reason */
- new_object.key_reference = start[8] + 1;
+ new_object.key_reference = 0x11;
@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);