Project

General

Profile

Actions

Feature #14278

open

Ambiguous Exception for OpenSSL::HMAC.digest

Added by KINGSABRI (KING SABRI) about 6 years ago. Updated almost 5 years ago.

Status:
Open
Assignee:
-
Target version:
-
[ruby-core:84620]

Description

The OpenSSL::HMAC.digest shows unclear and ambiguous exception when key is nil.

require 'openssl'

key = nil
OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), key, 'RubyRuby')
TypeError: no implicit conversion of nil into String
`digest'

Expected Behavior
So clear and understandable issue, such:

key argument cannot be nil for OpenSSL::HMAC.digest
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0