TS-4491: support sha256 and sha512 in ts_lua#681
TS-4491: support sha256 and sha512 in ts_lua#681shukitchan wants to merge 1 commit intoapache:masterfrom
Conversation
|
@jpeach this one should be simple. would appreciate if you can take a quick look and see if there is any trivial thing i miss. thanks. |
|
|
||
| #define TS_LUA_MD5_DIGEST_LENGTH 16 | ||
| #define TS_LUA_SHA_DIGEST_LENGTH 20 | ||
| #define TS_LUA_SHA256_DIGEST_LENGTH 32 |
There was a problem hiding this comment.
OpenSSL already has SHA256_DIGEST_LENGTH.
There was a problem hiding this comment.
I should change the other constants as well to use openssl.
|
It seems like luacrypto already gives pretty good access to the |
|
|
||
| ts.sha512 | ||
| ------- | ||
| **syntax:** *digest = ts.sha512(str)* |
There was a problem hiding this comment.
I think a better syntax might be to explicitly pass a parameter to specify the result format, eg, RAW, HEX, BASE64.
There was a problem hiding this comment.
we can add to that. And to keep backward compatibility, make those other functions to be alias to that.
|
These are just convenient and frequently used so we pulled them in instead of telling user to use external library. |
|
I am now thinking using luacrypto is a better choice. Closing for now. |
YTSATS-3965: Restore down nameservers after they come back online (apache#8847)
support sha256 and sha512 in ts_lua plugin