Browse Source

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>
v4.x
Adam Langley 9 years ago
committed by Myles Borins
parent
commit
9c3302bb97
  1. 2
      src/node_crypto.cc

2
src/node_crypto.cc

@ -5177,7 +5177,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)));
}

Loading…
Cancel
Save