-
Notifications
You must be signed in to change notification settings - Fork 0
ORE Operators and Sorting #86
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the simplicity of just using bytea (especially if it actually works!).
These changes introduce a potential side channel vulnerability though (timing attack) because the comparison now bails early.
1f0f791
to
542df82
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work. I bet you're glad to get this one over the line!
5bcfa35
to
dd69d98
Compare
This change reverts this repo back to 01dcc24. The changes reverted include commits from: - #86 - #87 We mostly want to revert the changes in #86 (since they aren't working as intended with Proxy), but #87 is also included since it's more recent (and also includes some ORE-related changes that would be tedious to untangle). Since there aren't many changes after #86, the most pragmatic option is to revert to the last known-good state and redo the install/uninstall changes by hand on top of that. Commands used to revert: ``` git reset --hard 01dcc24 git reset --soft ed460fc ``` This change doesn't use `git revert` because there were > 20 commits to revert and merge commits also don't play well with `git revert`.
This change updates `cs_ore_64_8_v1` to parse ORE indexes (the `'o'` field) as JSON arrays of hex-encoded strings (instead of casting from the Postgres text format). The corresponding change for encoding ORE indexes as JSON arrays of hex-encoded stings has already been merged in Proxy. This is similar to some of the changes in #86, but we're parsing into the composite types for ORE indexes instead of into a plain `bytea[]`. Parsing into the composite type allows for ordering with an operator class on the output from `cs_ore_64_8_v1`.
This change updates `cs_ore_64_8_v1` to parse ORE indexes (the `'o'` field) as JSON arrays of hex-encoded strings (instead of casting from the Postgres text format). The corresponding change for encoding ORE indexes as JSON arrays of hex-encoded stings has already been merged in Proxy. This is similar to some of the changes in #86, but we're parsing into the composite types for ORE indexes instead of into a plain `bytea[]`. Parsing into the composite type allows for ordering with an operator class on the output from `cs_ore_64_8_v1`.
Make ORDER by work for
cs_encrypted_v1
by encoding in the EQLjson
as an array rather than the PostgreSQL Ore Types.Example ORE encoding
Requires a corresponding change in the proxy to encode the ore index value as an array:
cipherstash/proxy#110
Current status: ORE works here, but does not work via proxy and I am not sure why.