Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate passwords with >72 characters #396

Closed
1 task done
henryde opened this issue Apr 12, 2023 · 6 comments · Fixed by #397
Closed
1 task done

Unable to generate passwords with >72 characters #396

henryde opened this issue Apr 12, 2023 · 6 comments · Fixed by #397
Labels

Comments

@henryde
Copy link

henryde commented Apr 12, 2023

Terraform CLI and Provider Versions

terraform: 1.4.2
provider: 3.5.0

Terraform Configuration

resource "random_password" "test" {
  length  = 73
}

Expected Behavior

generating longer passwords was possible with 3.4.3

Actual Behavior

╷
│ Error: Hash Generation Error
│
│   with random_password.test,
│   on test.tf line 1, in resource "random_password" "test":
│    1: resource "random_password" "test" {
│
│ While attempting to generate a hash from the password an error occurred.
│
│ Verify that the state contains a populated 'result' field, using 'terraform state show', and retry the operation
│
│ Original Error: bcrypt: password length exceeds 72 bytes
╵

Steps to Reproduce

  1. terraform apply

How much impact is this issue causing?

Medium

Logs

No response

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@henryde henryde added the bug label Apr 12, 2023
@ashhammond
Copy link

We are also seeing the exact same issue with the latest version of the provider. Rolling back and testing as suggested above.

@bflad
Copy link
Member

bflad commented Apr 12, 2023

Just to provide a reference for the upstream cryptography library (and general bcrypt) behavior: golang/go#36546

@ashhammond
Copy link

As a workaround we have now pinned the random provider to 3.4.3 and functionality is restored.

bendbennett added a commit that referenced this issue Apr 12, 2023
austinvalle pushed a commit that referenced this issue Apr 12, 2023
…es in length (#397)

* Truncating passwords that are longer than 72 bytes (#396)

* Adding changelog entry (#396)

* Updating changelog entry and docs (#396)

* Updating changelog entry (#396)

* updated comment msg
@austinvalle
Copy link
Member

Hi there @henryde 👋🏻 , thanks for submitting the issue and sorry you ran into this bug.

We've merged a fix for this bug with #397 and released v3.5.1 of the random provider with this bug fix. You should see that provider version become available in the next hour or so.

@ashhammond
Copy link

thanks @austinvalle for the quick fix.

Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
4 participants