]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: fix decoding of X.509 subject name; from Leif Thuresson
authordjm@openbsd.org <djm@openbsd.org>
Fri, 25 Jun 2021 06:30:22 +0000 (06:30 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 25 Jun 2021 06:32:34 +0000 (16:32 +1000)
via bz3327 ok markus@

OpenBSD-Commit-ID: 0ea2e28f39750dd388b7e317bc43dd997a217ae8

ssh-pkcs11.c

index 844aa9fff7402b1dc2fa4a1224592eadc156fd9b..4de29b34802f1986bd9fa4800ac8b1e41c81ca62 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-pkcs11.c,v 1.52 2020/11/22 22:38:26 djm Exp $ */
+/* $OpenBSD: ssh-pkcs11.c,v 1.53 2021/06/25 06:30:22 djm Exp $ */
 /*
  * Copyright (c) 2010 Markus Friedl.  All rights reserved.
  * Copyright (c) 2014 Pedro Martelletto. All rights reserved.
@@ -973,7 +973,7 @@ pkcs11_fetch_x509_pubkey(struct pkcs11_provider *p, CK_ULONG slotidx,
        }
 
        /* Decode DER-encoded cert subject */
-       cp = cert_attr[2].pValue;
+       cp = cert_attr[1].pValue;
        if ((x509_name = d2i_X509_NAME(NULL, &cp,
            cert_attr[1].ulValueLen)) == NULL ||
            (subject = X509_NAME_oneline(x509_name, NULL, 0)) == NULL)