SSL_get_shared_sigalgs.pod 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. =pod
  2. =head1 NAME
  3. SSL_get_shared_sigalgs, SSL_get_sigalgs - get supported signature algorithms
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. int SSL_get_shared_sigalgs(SSL *s, int idx,
  7. int *psign, int *phash, int *psignhash,
  8. unsigned char *rsig, unsigned char *rhash);
  9. int SSL_get_sigalgs(SSL *s, int idx,
  10. int *psign, int *phash, int *psignhash,
  11. unsigned char *rsig, unsigned char *rhash);
  12. =head1 DESCRIPTION
  13. SSL_get_shared_sigalgs() returns information about the shared signature
  14. algorithms supported by peer B<s>. The parameter B<idx> indicates the index
  15. of the shared signature algorithm to return starting from zero. The signature
  16. algorithm NID is written to B<*psign>, the hash NID to B<*phash> and the
  17. sign and hash NID to B<*psignhash>. The raw signature and hash values
  18. are written to B<*rsig> and B<*rhash>.
  19. SSL_get_sigalgs() is similar to SSL_get_shared_sigalgs() except it returns
  20. information about all signature algorithms supported by B<s> in the order
  21. they were sent by the peer.
  22. =head1 RETURN VALUES
  23. SSL_get_shared_sigalgs() and SSL_get_sigalgs() return the number of
  24. signature algorithms or B<0> if the B<idx> parameter is out of range.
  25. =head1 NOTES
  26. These functions are typically called for debugging purposes (to report
  27. the peer's preferences) or where an application wants finer control over
  28. certificate selection. Most applications will rely on internal handling
  29. and will not need to call them.
  30. If an application is only interested in the highest preference shared
  31. signature algorithm it can just set B<idx> to zero.
  32. Any or all of the parameters B<psign>, B<phash>, B<psignhash>, B<rsig> or
  33. B<rhash> can be set to B<NULL> if the value is not required. By setting
  34. them all to B<NULL> and setting B<idx> to zero the total number of
  35. signature algorithms can be determined: which can be zero.
  36. These functions must be called after the peer has sent a list of supported
  37. signature algorithms: after a client hello (for servers) or a certificate
  38. request (for clients). They can (for example) be called in the certificate
  39. callback.
  40. Only TLS 1.2 and DTLS 1.2 currently support signature algorithms. If these
  41. functions are called on an earlier version of TLS or DTLS zero is returned.
  42. The shared signature algorithms returned by SSL_get_shared_sigalgs() are
  43. ordered according to configuration and peer preferences.
  44. The raw values correspond to the on the wire form as defined by RFC5246 et al.
  45. The NIDs are OpenSSL equivalents. For example if the peer sent sha256(4) and
  46. rsa(1) then B<*rhash> would be 4, B<*rsign> 1, B<*phash> NID_sha256, B<*psig>
  47. NID_rsaEncryption and B<*psighash> NID_sha256WithRSAEncryption.
  48. If a signature algorithm is not recognised the corresponding NIDs
  49. will be set to B<NID_undef>. This may be because the value is not supported
  50. or is not an appropriate combination (for example MD5 and DSA).
  51. =head1 SEE ALSO
  52. L<SSL_CTX_set_cert_cb(3)>,
  53. L<ssl(7)>
  54. =head1 COPYRIGHT
  55. Copyright 2015-2016 The OpenSSL Project Authors. All Rights Reserved.
  56. Licensed under the OpenSSL license (the "License"). You may not use
  57. this file except in compliance with the License. You can obtain a copy
  58. in the file LICENSE in the source distribution or at
  59. L<https://www.openssl.org/source/license.html>.
  60. =cut