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

support set "forever" on valid_before field of the certificate #15

Closed
gzm55 opened this issue May 20, 2023 · 5 comments
Closed

support set "forever" on valid_before field of the certificate #15

gzm55 opened this issue May 20, 2023 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@gzm55
Copy link

gzm55 commented May 20, 2023

when sign by ssh-keygen, in valid_before field, the "forever" is translated to 2**64-1. This behavior is not supported by sshkey-tools now.

@scheibling
Copy link
Collaborator

scheibling commented May 20, 2023

I'll put it in the next update (EOW) along with restoring the functionality for choosing the RSA Algo. Thanks for the feedback!

Edit: In the meantime, you can pass integers to that field on creation as well. The plan is to add strings as allowed types and to parse them with something like pytimeparse

@scheibling scheibling self-assigned this May 20, 2023
@scheibling scheibling added the enhancement New feature or request label May 20, 2023
@scheibling scheibling added this to the 0.9.2 milestone May 20, 2023
@scheibling
Copy link
Collaborator

Fixed in #17 , you can now specify a string like "2w", "1d4h" or similar (according to the specification in pytimeparse2, including "forever" which will set the expiration time to MAX_INT64.

Also updated the docs in #18

It'll be included in upcoming release 0.9.2 on pypi

@gzm55
Copy link
Author

gzm55 commented May 20, 2023

@scheibling MAX_INT64 is 2**64, which is too large for 64 bit integer. The stack is

    return pack(">Q", value)
           ^^^^^^^^^^^^^^^^^
struct.error: int too large to convert

It seems that MAX_INT64 - 1 should be used.

@scheibling scheibling reopened this May 20, 2023
@scheibling
Copy link
Collaborator

Saw this earlier but it seems it managed to slip my mind.. I'll fix it, thanks for checking. Have somewhere on my to-do list to add some more tests as well to catch things like this.

@scheibling
Copy link
Collaborator

Resolved through #17 and bugs in #20 #21

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants