Skip to content

Commit

Permalink
Rename jwe.WithMaxBufferSize to jwe.WithMaxAESCBCBufferSize (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
lestrrat authored Mar 9, 2024
1 parent 7f11f98 commit 13ca3a5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion jwe/jwe.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ func Settings(options ...GlobalOption) {
maxPBES2Count = option.Value().(int)
case identMaxDecompressBufferSize{}:
maxDecompressBufferSize = option.Value().(int64)
case identMaxBufferSize{}:
case identMaxAESCBCBufferSize{}:
aescbc.SetMaxBufferSize(option.Value().(int64))
}
}
Expand Down
6 changes: 3 additions & 3 deletions jwe/jwe_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -961,10 +961,10 @@ func TestGHSA_7f9x_gw85_8grf(t *testing.T) {
}
}

func TestMaxBufferSize(t *testing.T) {
func TestMaxAESCBCBufferSize(t *testing.T) {
// NOTE: This has GLOBAL EFFECT
jwe.Settings(jwe.WithMaxBufferSize(1))
defer jwe.Settings(jwe.WithMaxBufferSize(0))
jwe.Settings(jwe.WithMaxAESCBCBufferSize(1))
defer jwe.Settings(jwe.WithMaxAESCBCBufferSize(0))

key, err := jwxtest.GenerateRsaJwk()
require.NoError(t, err, `jwxtest.GenerateRsaJwk should succeed`)
Expand Down
6 changes: 3 additions & 3 deletions jwe/options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ options:
This option can be used for `jwe.Settings()`, which changes the behavior
globally, or for `jwe.Decrypt()`, which changes the behavior for that
specific call.
- ident: MaxBufferSize
- ident: MaxAESCBCBufferSize
interface: GlobalOption
argument_type: int64
comment: |
WithMaxBufferSize specifies the maximum buffer size for internal
calculations, such as when AES-CBC is performed. The default value is 256MB.
WithMaxAESCBCBufferSize specifies the maximum buffer size for internal
AES-CBC calculations. The default value is 256MB.
If set to an invalid value, the default value is used.
This option has a global effect.
Expand Down
14 changes: 7 additions & 7 deletions jwe/options_gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion jwe/options_gen_test.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13ca3a5

Please sign in to comment.