Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypt-PKCS11-1.03 using Crypt::PKCS11::Attribute::Value in a template fails __check_pTemplate check #15

Closed
jelu opened this issue May 6, 2016 · 0 comments
Assignees

Comments

@jelu
Copy link
Member

jelu commented May 6, 2016

https://rt.cpan.org/Ticket/Display.html?id=114205
From: Tuure Vartiainen vartiait@open.com.au

Hello,

with Crypt-PKCS11-1.03 when using Crypt::PKCS11::Attribute::Value in a template,
__check_pTemplate check seems to fail for the attribute.

More precisely SvUOK(sv) in crypt_pkcs11_xs_SvUOK(SV* sv) returns a non-zero value
when checking Crypt::PKCS11::Attribute::Value.

When comparing Crypt::PKCS11::Attribute::Label and Crypt::PKCS11::Attribute::Value types
being checked in crypt_pkcs11_xs_SvUOK(SV* sv), difference was

(SV) $4 = {
  sv_any = 0x0000000101dbf648
  sv_refcnt = 1
  sv_flags = 21765
  sv_u = {
    svu_pv = 0x0000000102a13420 "3"
    svu_iv = 4339086368
    svu_uv = 4339086368
    svu_nv = 2.1437935087668688E-314
    svu_rv = 0x0000000102a13420
    svu_rx = 0x0000000102a13420
    svu_array = 0x0000000102a13420
    svu_hash = 0x0000000102a13420
    svu_gp = 0x0000000102a13420
    svu_fp = 0x0000000102a13420
  }
}

(SV) $5 = {
  sv_any = 0x0000000101259b60
  sv_refcnt = 1
  sv_flags = 268452867
  sv_u = {
    svu_pv = 0x000000010067c6d0 "CKA_VALUE"
    svu_iv = 4301768400
    svu_uv = 4301768400
    svu_nv = 2.1253559828054658E-314
    svu_rv = 0x000000010067c6d0
    svu_rx = 0x000000010067c6d0
    svu_array = 0x000000010067c6d0
    svu_hash = 0x000000010067c6d0
    svu_gp = 0x000000010067c6d0
    svu_fp = 0x000000010067c6d0
  }
}

Crypt::PKCS11::Attribute::Value seemed to be an only class which direct parent
is Crypt::PKCS11::Attribute and which defines type() in a class itself.

Problem seemed to fix by renaming Crypt::PKCS11::Attribute::Value to
Crypt::PKCS11::Attribute::ValueBase and defining Crypt::PKCS11::Attribute::Value
in a same way as other attribute classes.

Perl version used is 5.23.8.

@jelu jelu self-assigned this May 6, 2016
@jelu jelu added the invalid label May 8, 2016
@jelu jelu closed this as completed May 8, 2016
@jelu jelu removed the invalid label May 8, 2016
@jelu jelu reopened this May 8, 2016
@jelu jelu closed this as completed in b9844aa May 8, 2016
jelu added a commit that referenced this issue May 8, 2016
Fix #15: Did not import contants so Perl magically returned a string …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant