Skip to content

Commit

Permalink
Simplify handling of oaep label (#531)
Browse files Browse the repository at this point in the history
  • Loading branch information
qpernil authored Feb 4, 2025
1 parent 3b1b91d commit 4807151
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ykcs11/mechanisms.c
Original file line number Diff line number Diff line change
Expand Up @@ -692,6 +692,7 @@ CK_RV decrypt_mechanism_init(ykcs11_session_t *session, ykcs11_pkey_t *key, CK_M
session->op_info.op.encrypt.algorithm = do_get_key_algorithm(key);
session->op_info.op.encrypt.key = key;
session->op_info.op.encrypt.oaep_label = NULL;
session->op_info.op.encrypt.oaep_label_len = 0;

switch (session->op_info.mechanism) {
case CKM_RSA_X_509:
Expand All @@ -717,9 +718,6 @@ CK_RV decrypt_mechanism_init(ykcs11_session_t *session, ykcs11_pkey_t *key, CK_M
}
memcpy(session->op_info.op.encrypt.oaep_label, oaep->pSourceData, oaep->ulSourceDataLen);
session->op_info.op.encrypt.oaep_label_len = oaep->ulSourceDataLen;
} else {
session->op_info.op.encrypt.oaep_label = NULL;
session->op_info.op.encrypt.oaep_label_len = 0;
}
break;
default:
Expand Down

0 comments on commit 4807151

Please sign in to comment.