0
0
mirror of https://github.com/nodejs/node.git synced 2024-12-01 16:10:02 +01:00

crypto: use a const SSL_CIPHER

SSL_CIPHER objects are conceptually const in any case and this allows
STACK_OF(SSL_CIPHER) to return a const pointer, as is done in BoringSSL
and, perhaps, OpenSSL in the future.

PR-URL: https://github.com/nodejs/node/pull/4913
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Adam Langley 2016-01-27 10:58:09 -08:00 committed by Fedor Indutny
parent ff4006c7b0
commit f8d24c54a8

View File

@ -5370,7 +5370,7 @@ void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) {
STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl);
for (int i = 0; i < sk_SSL_CIPHER_num(ciphers); ++i) {
SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i);
const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i);
arr->Set(i, OneByteString(args.GetIsolate(), SSL_CIPHER_get_name(cipher)));
}