* Remove redundant sections from mechanism check * Fix conditional oddly-built conditional
Signed-off-by: Klaus Heinrich Kiwi <[email protected]> --- usr/lib/pkcs11/common/key_mgr.c | 13 +------------ 1 files changed, 1 insertions(+), 12 deletions(-) diff --git a/usr/lib/pkcs11/common/key_mgr.c b/usr/lib/pkcs11/common/key_mgr.c index 8f87b84..b1f699c 100755 --- a/usr/lib/pkcs11/common/key_mgr.c +++ b/usr/lib/pkcs11/common/key_mgr.c @@ -1069,10 +1069,6 @@ key_mgr_unwrap_key( SESSION * sess, switch (mech->mechanism) { case CKM_RSA_PKCS: case CKM_RSA_X_509: - keyclass = CKO_SECRET_KEY; - found_class = TRUE; - break; - #if !(NOCMF) case CKM_CDMF_ECB: case CKM_CDMF_CBC: @@ -1120,8 +1116,7 @@ key_mgr_unwrap_key( SESSION * sess, // if we're unwrapping a private key, we can extract the key type from // the BER-encoded information // - if (found_class == FALSE || (found_type == FALSE && keyclass != -CKO_PRIVATE_KEY)){ + if (found_type == FALSE && keyclass != CKO_PRIVATE_KEY){ st_err_log(48, __FILE__, __LINE__); return CKR_TEMPLATE_INCOMPLETE; } @@ -1131,12 +1126,6 @@ CKO_PRIVATE_KEY)){ switch (mech->mechanism) { case CKM_RSA_PKCS: case CKM_RSA_X_509: - if (keyclass != CKO_SECRET_KEY){ - st_err_log(49, __FILE__, __LINE__); - return CKR_TEMPLATE_INCONSISTENT; - } - break; - #if !(NOCMF) case CKM_CDMF_ECB: case CKM_CDMF_CBC: -- 1.7.2 ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Opencryptoki-tech mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/opencryptoki-tech
