Skip to content

HMAC.copy() does not correctly copy its attributes #142451

@YuanchengJiang

Description

@YuanchengJiang

Crash report

What happened?

import hmac
import hashlib

h = hmac.HMAC(b'key', digestmod=hashlib.sha256)
h_copy = h.copy()
print(h_copy.name)
python: ../Modules/_hashopenssl.c:610: const char *get_asn1_utf8name_by_nid(int): Assertion `ERR_peek_last_error() != 0' failed

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Output from running 'python -VV' on the command line:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

extension-modulesC modules in the Modules dirstdlibStandard Library Python modules in the Lib/ directorytype-crashA hard crash of the interpreter, possibly with a core dump

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions