From 739c5e76f73bd0f785a73ac794697ea465c34710 Mon Sep 17 00:00:00 2001 From: Jonathan Patchell Date: Tue, 7 Jan 2020 11:19:08 -0500 Subject: [PATCH] Fixing compilation issues and tests for recent Luna client. --- pkcs11_luna/ext/generate_constants.rb | 2 +- pkcs11_luna/ext/pk11l.c | 1 + pkcs11_luna/test/test_pkcs11_luna.rb | 2 +- pkcs11_luna/test/test_pkcs11_luna_crypt.rb | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/pkcs11_luna/ext/generate_constants.rb b/pkcs11_luna/ext/generate_constants.rb index bccec45..4a86581 100644 --- a/pkcs11_luna/ext/generate_constants.rb +++ b/pkcs11_luna/ext/generate_constants.rb @@ -42,7 +42,7 @@ def start! next if constants_hash[const_name].nil? const_group_def = constants_hash[const_name][0] const_value = constants_hash[const_name][1] - fd_const.puts "#{const_group_def}(#{const_name}); /* #{const_value} */" + fd_const.puts "#{const_group_def}(#{const_name}); // #{const_value} " constants_hash[const_name] = nil end end diff --git a/pkcs11_luna/ext/pk11l.c b/pkcs11_luna/ext/pk11l.c index 018f226..7d02db4 100644 --- a/pkcs11_luna/ext/pk11l.c +++ b/pkcs11_luna/ext/pk11l.c @@ -41,6 +41,7 @@ static VALUE aCK_MECHANISM_INFO_members; static VALUE cCK_SESSION_INFO; static VALUE aCK_SESSION_INFO_members; static VALUE cCK_MECHANISM; +static VALUE cCK_ATTRIBUTE; static VALUE vOBJECT_CLASSES; static VALUE vATTRIBUTES; diff --git a/pkcs11_luna/test/test_pkcs11_luna.rb b/pkcs11_luna/test/test_pkcs11_luna.rb index 5cec2bd..2d55b8b 100644 --- a/pkcs11_luna/test/test_pkcs11_luna.rb +++ b/pkcs11_luna/test/test_pkcs11_luna.rb @@ -76,7 +76,7 @@ def test_init_token pkcs11 = @pk slot = Slot.new(pkcs11, @slot) - assert_raises(Luna::CKR_OPERATION_NOT_ALLOWED, CKR_USER_TYPE_INVALID) { + assert_raises(Luna::CKR_OPERATION_NOT_ALLOWED, CKR_DATA_LEN_RANGE, CKR_USER_TYPE_INVALID) { slot.init_token("anypin", "new_label") } end diff --git a/pkcs11_luna/test/test_pkcs11_luna_crypt.rb b/pkcs11_luna/test/test_pkcs11_luna_crypt.rb index 2d2e5dd..d55b325 100644 --- a/pkcs11_luna/test/test_pkcs11_luna_crypt.rb +++ b/pkcs11_luna/test/test_pkcs11_luna_crypt.rb @@ -95,7 +95,7 @@ def test_generate_rsa_key_pair destroy_object(@session, priv_label) pub_attr = {ENCRYPT: true, VERIFY: true, - MODULUS_BITS: 2048, TOKEN: true, WRAP: true, LABEL: pub_label} + MODULUS_BITS: 2048, TOKEN: true, WRAP: true, LABEL: pub_label, PUBLIC_EXPONENT: [0x01, 0x00, 0x01].pack('C*')} priv_attr = {DECRYPT: true, SIGN: true, SENSITIVE: true, PRIVATE: true, TOKEN: true, UNWRAP: true, LABEL: priv_label}