Skip to content

TS-4491: support sha256 and sha512 in ts_lua#681

Closed
shukitchan wants to merge 1 commit intoapache:masterfrom
shukitchan:sha256
Closed

TS-4491: support sha256 and sha512 in ts_lua#681
shukitchan wants to merge 1 commit intoapache:masterfrom
shukitchan:sha256

Conversation

@shukitchan
Copy link
Contributor

support sha256 and sha512 in ts_lua plugin

@shukitchan
Copy link
Contributor Author

@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
Copy link
Contributor

Choose a reason for hiding this comment

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

OpenSSL already has SHA256_DIGEST_LENGTH.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I should change the other constants as well to use openssl.

@jpeach
Copy link
Contributor

jpeach commented May 31, 2016

It seems like luacrypto already gives pretty good access to the OpenSSL hash APIs. Do we need to duplicate that?


ts.sha512
-------
**syntax:** *digest = ts.sha512(str)*
Copy link
Contributor

Choose a reason for hiding this comment

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

I think a better syntax might be to explicitly pass a parameter to specify the result format, eg, RAW, HEX, BASE64.

Copy link
Contributor Author

@shukitchan shukitchan May 31, 2016

Choose a reason for hiding this comment

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

we can add to that. And to keep backward compatibility, make those other functions to be alias to that.

@shukitchan
Copy link
Contributor Author

These are just convenient and frequently used so we pulled them in instead of telling user to use external library.

@zwoop zwoop added this to the 7.0.0 milestone May 31, 2016
@shukitchan
Copy link
Contributor Author

I am now thinking using luacrypto is a better choice. Closing for now.

@shukitchan shukitchan closed this Jun 3, 2016
@zwoop zwoop modified the milestone: 7.0.0 May 4, 2017
JosiahWI pushed a commit to JosiahWI/trafficserver that referenced this pull request Jul 19, 2023
YTSATS-3965: Restore down nameservers after they come back online (apache#8847)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants