-
Notifications
You must be signed in to change notification settings - Fork 427
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix broken compilation due to failing
ct_expand
parse transform
- `parse_trans` needs to be imported as a dependency - `ct_expand` needs to be applied to `hackney_ssl` at compile time - the extraction of public key info from certificates needs to be moved to a separate module (`hackney_ssl_certificate`) because the record definitions are not available during the `ct_expand` compilation pass - this separate module needs to be compiled before `hackney_ssl` to ensure it's available at compile time (`erl_first_files` declaration in `rebar.config)
- Loading branch information
Showing
5 changed files
with
32 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
idna, | ||
mimerl, | ||
certifi, | ||
parse_trans, | ||
ssl_verify_fun, | ||
metrics]}, | ||
{included_applications, []}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
%%% -*- erlang -*- | ||
%%% | ||
%%% This file is part of hackney released under the Apache 2 license. | ||
%%% See the NOTICE for more information. | ||
%%% | ||
|
||
%% @private | ||
-module(hackney_ssl_certificate). | ||
|
||
-include_lib("public_key/include/OTP-PUB-KEY.hrl"). | ||
|
||
-export( | ||
[public_key_info/1 | ||
]). | ||
|
||
-spec public_key_info(Cert) -> PKI | ||
when Cert :: #'OTPCertificate'{tbsCertificate :: TBSCert}, | ||
TBSCert :: #'OTPTBSCertificate'{subjectPublicKeyInfo :: PKI}. | ||
public_key_info(Cert) -> | ||
((Cert#'OTPCertificate'.tbsCertificate)#'OTPTBSCertificate'.subjectPublicKeyInfo). |