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

Add Marshal support to PKey objects #363

Merged
merged 1 commit into from
Apr 20, 2020
Merged

Conversation

bdewater
Copy link
Contributor

@bdewater bdewater commented Apr 19, 2020

@mperham
Copy link

mperham commented Apr 19, 2020

The usecase I saw had a hash with Certificate, PKey and X509::Store marshaled. Does the latter work? See sidekiq/sidekiq#4531

@bdewater
Copy link
Contributor Author

bdewater commented Apr 19, 2020

Certificate support was done in #281 where my use case was dumping certificates and CRLs in a Rails cache, public/private keys done here fit that as well.

X509::Store doesn't implement to_der and since it allows setting a verify_callback proc/lamdba it's not easily possible either. Outside of using Marshal as a deep cloning mechanism I'm not sure why one would need it in practice. It's a wrapper around an array of trusted certificates (@chain) and some ephemeral verification state.

It seems to me it's safer for Sidekiq to selectively clone objects being scrubbed. Otherwise you keep playing whack-a-mole with random objects not implementing the Marshal interface.

Copy link
Member

@rhenium rhenium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks.

@rhenium rhenium merged commit 2ca54fe into ruby:master Apr 20, 2020
@bdewater bdewater deleted the marshal-pkey branch April 26, 2020 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants