Skip to content

Commit

Permalink
Fixed Enum
Browse files Browse the repository at this point in the history
  • Loading branch information
gamringer committed Mar 21, 2021
1 parent 6d767b8 commit ed6a096
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions pkcs11int.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ typedef struct _pkcs11_keypair_object {
} pkcs11_keypair_object;

enum knownParamTypes {
None,
GcmParams,
RsaOaepParams,
RsaPssParams,
Expand Down
8 changes: 4 additions & 4 deletions pkcs11mechanism.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ PHP_METHOD(Mechanism, __construct) {
} else if (Z_TYPE_P(mechanismArgument) == IS_OBJECT) {
if(zend_string_equals_literal(Z_OBJ_P(mechanismArgument)->ce->name, "Pkcs11\\GcmParams")) {
pkcs11_gcmparams_object *mechanismParamsObj = Z_PKCS11_GCMPARAMS_P(mechanismArgument);
objval->paramsObj = &mechanismParamsObj;
objval->paramsObj = mechanismParamsObj;
objval->paramsObjType = GcmParams;
objval->mechanism.pParameter = &mechanismParamsObj->params;
objval->mechanism.ulParameterLen = sizeof(mechanismParamsObj->params);
Expand All @@ -58,7 +58,7 @@ PHP_METHOD(Mechanism, __construct) {

if(zend_string_equals_literal(Z_OBJ_P(mechanismArgument)->ce->name, "Pkcs11\\RsaOaepParams")) {
pkcs11_rsaoaepparams_object *mechanismParamsObj = Z_PKCS11_RSAOAEPPARAMS_P(mechanismArgument);
objval->paramsObj = &mechanismParamsObj;
objval->paramsObj = mechanismParamsObj;
objval->paramsObjType = RsaOaepParams;
objval->mechanism.pParameter = &mechanismParamsObj->params;
objval->mechanism.ulParameterLen = sizeof(mechanismParamsObj->params);
Expand All @@ -67,7 +67,7 @@ PHP_METHOD(Mechanism, __construct) {

if(zend_string_equals_literal(Z_OBJ_P(mechanismArgument)->ce->name, "Pkcs11\\RsaPssParams")) {
pkcs11_rsapssparams_object *mechanismParamsObj = Z_PKCS11_RSAPSSPARAMS_P(mechanismArgument);
objval->paramsObj = &mechanismParamsObj;
objval->paramsObj = mechanismParamsObj;
objval->paramsObjType = RsaPssParams;
objval->mechanism.pParameter = &mechanismParamsObj->params;
objval->mechanism.ulParameterLen = sizeof(mechanismParamsObj->params);
Expand All @@ -76,7 +76,7 @@ PHP_METHOD(Mechanism, __construct) {

if(zend_string_equals_literal(Z_OBJ_P(mechanismArgument)->ce->name, "Pkcs11\\Ecdh1DeriveParams")) {
pkcs11_ecdh1deriveparams_object *mechanismParamsObj = Z_PKCS11_ECDH1DERIVEPARAMS_P(mechanismArgument);
objval->paramsObj = &mechanismParamsObj;
objval->paramsObj = mechanismParamsObj;
objval->paramsObjType = Ecdh1DeriveParams;
objval->mechanism.pParameter = &mechanismParamsObj->params;
objval->mechanism.ulParameterLen = sizeof(mechanismParamsObj->params);
Expand Down

0 comments on commit ed6a096

Please sign in to comment.