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

Fix timestamp response buffer allocation if response size is unknown. #118

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

wlynch
Copy link
Contributor

@wlynch wlynch commented Sep 26, 2022

When trying this out against freetsa.org, I got the following error:

runtime error: makeslice: cap out of range

This seems to stem from the buffer allocation if ContentLength = -1. From the net/http docs:

ContentLength records the length of the associated content. The
value -1 indicates that the length is unknown.

Not sure why working with freetsa is causing a -1 to be returned, but this changes the behavior to work in either case.

When trying this out against freetsa.org, I got the following error:

```
runtime error: makeslice: cap out of range
```

This seems to stem from the buffer allocation if ContentLength = -1.
From the net/http docs:

```
ContentLength records the length of the associated content. The
value -1 indicates that the length is unknown.
```

Not sure why working with freetsa is causing a -1 to be returned, but
this changes the behavior to work in either case.
wlynch added a commit to wlynch/gitsign that referenced this pull request Oct 14, 2022
Adds GITSIGN_TIMESTAMP_AUTHORITY config option for specifying a TSA URL in the gitsign config.
Also adds an e2e test since this is a pain to test without a real TSA.

Note: certain TSA (notably freetsa.org) do not work due to a bug. github/smimesign#118. Trying to fix upstream.
wlynch added a commit to wlynch/gitsign that referenced this pull request Oct 14, 2022
Adds GITSIGN_TIMESTAMP_AUTHORITY config option for specifying a TSA URL in the gitsign config.
Also adds an e2e test since this is a pain to test without a real TSA.

Note: certain TSA (notably freetsa.org) do not work due to a bug. github/smimesign#118. Trying to fix upstream.
Signed-off-by: Billy Lynch <billy@chainguard.dev>
wlynch added a commit to sigstore/gitsign that referenced this pull request Oct 17, 2022
Adds GITSIGN_TIMESTAMP_AUTHORITY config option for specifying a TSA URL in the gitsign config.
Also adds an e2e test since this is a pain to test without a real TSA.

Note: certain TSA (notably freetsa.org) do not work due to a bug. github/smimesign#118. Trying to fix upstream.
Signed-off-by: Billy Lynch <billy@chainguard.dev>

Signed-off-by: Billy Lynch <billy@chainguard.dev>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant