You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.4 KiB

  1. From d94226d4fcefbc398c5583e12b5d07ca33884ba4 Mon Sep 17 00:00:00 2001
  2. From: "djm@openbsd.org" <djm@openbsd.org>
  3. Date: Thu, 27 Dec 2018 23:02:11 +0000
  4. Subject: upstream: Request RSA-SHA2 signatures for
  5. rsa-sha2-{256|512}-cert-v01@openssh.com cert algorithms; ok markus@
  6. OpenBSD-Commit-ID: afc6f7ca216ccd821656d1c911d2a3deed685033
  7. Origin: upstream, https://anongit.mindrot.org/openssh.git/commit/?id=f429c1b2ef631f2855e51a790cf71761d752bbca
  8. Bug: https://bugzilla.mindrot.org/show_bug.cgi?id=2944
  9. Bug-Debian: https://bugs.debian.org/923419
  10. Last-Update: 2019-02-28
  11. Patch-Name: request-rsa-sha2-cert-signatures.patch
  12. ---
  13. authfd.c | 8 +++++---
  14. 1 file changed, 5 insertions(+), 3 deletions(-)
  15. diff --git a/authfd.c b/authfd.c
  16. index ecdd869ab..62cbf8c19 100644
  17. --- a/authfd.c
  18. +++ b/authfd.c
  19. @@ -327,10 +327,12 @@ ssh_free_identitylist(struct ssh_identitylist *idl)
  20. static u_int
  21. agent_encode_alg(const struct sshkey *key, const char *alg)
  22. {
  23. - if (alg != NULL && key->type == KEY_RSA) {
  24. - if (strcmp(alg, "rsa-sha2-256") == 0)
  25. + if (alg != NULL && sshkey_type_plain(key->type) == KEY_RSA) {
  26. + if (strcmp(alg, "rsa-sha2-256") == 0 ||
  27. + strcmp(alg, "rsa-sha2-256-cert-v01@openssh.com") == 0)
  28. return SSH_AGENT_RSA_SHA2_256;
  29. - else if (strcmp(alg, "rsa-sha2-512") == 0)
  30. + if (strcmp(alg, "rsa-sha2-512") == 0 ||
  31. + strcmp(alg, "rsa-sha2-512-cert-v01@openssh.com") == 0)
  32. return SSH_AGENT_RSA_SHA2_512;
  33. }
  34. return 0;