Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
3107-public_key-Fix-compatibility-with-new-erro...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 3107-public_key-Fix-compatibility-with-new-error-schema-i.patch of Package erlang
From 0210f79b035d58d6dc798f9cded071fc6e8e7603 Mon Sep 17 00:00:00 2001 From: Hans Nilsson <hans@erlang.org> Date: Thu, 17 Mar 2022 17:17:42 +0100 Subject: [PATCH 7/8] public_key: Fix compatibility with new error schema in crypto --- lib/public_key/src/public_key.erl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/public_key/src/public_key.erl b/lib/public_key/src/public_key.erl index d41d4ed7ba..14b6043286 100644 --- a/lib/public_key/src/public_key.erl +++ b/lib/public_key/src/public_key.erl @@ -829,7 +829,12 @@ sign(DigestOrPlainText, DigestType, Key, Options) -> badarg -> erlang:error(badarg, [DigestOrPlainText, DigestType, Key, Options]); {Algorithm, CryptoKey} -> - crypto:sign(Algorithm, DigestType, DigestOrPlainText, CryptoKey, Options) + try crypto:sign(Algorithm, DigestType, DigestOrPlainText, CryptoKey, Options) + catch %% Compatible with old error schema + error:{notsup,_,_} -> error(notsup); + error:{error,_,_} -> error(error); + error:{badarg,_,_} -> error(badarg) + end end. %%-------------------------------------------------------------------- @@ -859,7 +864,12 @@ verify(DigestOrPlainText, DigestType, Signature, Key, Options) when is_binary(Si badarg -> erlang:error(badarg, [DigestOrPlainText, DigestType, Signature, Key, Options]); {Algorithm, CryptoKey} -> - crypto:verify(Algorithm, DigestType, DigestOrPlainText, Signature, CryptoKey, Options) + try crypto:verify(Algorithm, DigestType, DigestOrPlainText, Signature, CryptoKey, Options) + catch %% Compatible with old error schema + error:{notsup,_,_} -> error(notsup); + error:{error,_,_} -> error(error); + error:{badarg,_,_} -> error(badarg) + end end; verify(_,_,_,_,_) -> %% If Signature is a bitstring and not a binary we know already at this -- 2.34.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor