s2n_signature_algorithms.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License").
  5. * You may not use this file except in compliance with the License.
  6. * A copy of the License is located at
  7. *
  8. * http://aws.amazon.com/apache2.0
  9. *
  10. * or in the "license" file accompanying this file. This file is distributed
  11. * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  12. * express or implied. See the License for the specific language governing
  13. * permissions and limitations under the License.
  14. */
  15. #pragma once
  16. #include "api/s2n.h"
  17. #include "crypto/s2n_hash.h"
  18. #include "crypto/s2n_signature.h"
  19. #include "stuffer/s2n_stuffer.h"
  20. #include "tls/s2n_signature_scheme.h"
  21. struct s2n_connection;
  22. struct s2n_sig_scheme_list {
  23. uint16_t iana_list[TLS_SIGNATURE_SCHEME_LIST_MAX_LEN];
  24. uint8_t len;
  25. };
  26. int s2n_choose_default_sig_scheme(struct s2n_connection *conn,
  27. const struct s2n_signature_scheme **sig_scheme_out, s2n_mode signer);
  28. int s2n_tls13_default_sig_scheme(struct s2n_connection *conn,
  29. const struct s2n_signature_scheme **sig_scheme_out);
  30. int s2n_choose_sig_scheme_from_peer_preference_list(struct s2n_connection *conn,
  31. struct s2n_sig_scheme_list *sig_hash_algs,
  32. const struct s2n_signature_scheme **sig_scheme_out);
  33. S2N_RESULT s2n_signature_algorithm_recv(struct s2n_connection *conn, struct s2n_stuffer *in);
  34. int s2n_recv_supported_sig_scheme_list(struct s2n_stuffer *in, struct s2n_sig_scheme_list *sig_hash_algs);
  35. S2N_RESULT s2n_signature_algorithms_supported_list_send(struct s2n_connection *conn,
  36. struct s2n_stuffer *out);