Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8226651

Setting the mgfHash in CK_RSA_PKCS_PSS_PARAMS has no effect

    Details

      Backports

        Description

        A DESCRIPTION OF THE PROBLEM :
        The constructor of the class sun.security.pkcs11.wrapper.CK_RSA_PKCS_PSS_PARAMS takes the hashAlg to get the MGF function. This should, however, be extracted from the mgfHash parameter.

        STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
        Read the source code block:

            public CK_RSA_PKCS_PSS_PARAMS(String hashAlg, String mgfAlg,
                    String mgfHash, int sLen) {
                this.hashAlg = Functions.getHashMechId(hashAlg);
                if (!mgfAlg.equals("MGF1")) {
                    throw new ProviderException("Only MGF1 is supported");
                }
                // no dash in PKCS#11 mechanism names
                this.mgf = Functions.getMGFId("CKG_MGF1_" + hashAlg.replaceFirst("-", ""));
                this.sLen = sLen;
        }


        FREQUENCY : always


          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  valeriep Valerie Peng
                  Reporter:
                  webbuggrp Webbug Group
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Due:
                    Created:
                    Updated:
                    Resolved: