Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-4908

pw_hash does not support Sensitive data type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: stdlib
    • Labels:
      None
    • Template:
      MODULES Bug Template
    • Team:
      Modules
    • QA Risk Assessment:
      Needs Assessment

      Description

      The pw_hash function only accepts strings as inputs. This means that if you are using the Sensitive data type for passing passwords around (e.g. from hiera-eyaml), they need to be unwrapped before passing to pw_hash.

      This code:

      $password = Sensitive.new('hunter2')
      $salt     = Sensitive.new('wubbalubbadubdub')
      pw_hash($password,'SHA-512',$salt)
      

      Gives me this error:

      Error: Evaluation Error: Error while evaluating a Function Call, pw_hash(): first argument must be a string at /home/centos/test.pp:3:1 on node master.prod.puppet.com
      

      I would expect that it should just work™

        Attachments

          Activity

            People

            Assignee:
            eric.putnam Eric Putnam
            Reporter:
            dylan.ratcliffe Dylan Ratcliffe
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Zendesk Support