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>
process-exit-stdio-flushing
Adam Langley 9 years ago
committed by Fedor Indutny
parent
commit
f8d24c54a8
  1. 2
      src/node_crypto.cc

2
src/node_crypto.cc

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

Loading…
Cancel
Save