From nobody Fri Apr 19 20:34:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1616965855; cv=none; d=zohomail.com; s=zohoarc; b=fFgvIInu/WdL0l5ILOOThTY9xLfnptN8ZeD7zL1CH2LAWN8G4xbq2lfwCe8ywWGCAScYRzBKKh0Btc5vFqoh8eGc35/y4QVUOPIFiglpNJY2AkX9L2JxUBPavdoU9n7eWh1ULkRxFIFlh9SKYvwB9wBdHWhmHhOzGRwXgFhm+e0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1616965855; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=rZ11svgJNlE8FSsTmEEls3lHZlV5fm+5+uQfKJeQPRc=; b=JWiuC+Cnj0rlkAqBtD2JfUxLiIBlelyEgn7wzik1R7//h+UMCmUrneQ7em6nOTecqyLRCYRZ7R/jNWWFw/g/2gjGlSlM1kgBd2DJj10/bMsrjN9Hg1UsSx+fFAl+CC8BSLAS19oU7nJqz4G+wz6HonjkQpOVEsIyzBaLS0T2efI= ARC-Authentication-Results: i=1; mx.zohomail.com; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1616965855085757.5970024742795; Sun, 28 Mar 2021 14:10:55 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-8N9BOK5QOaWg67D1kX1QTQ-1; Sun, 28 Mar 2021 17:10:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D9B3B180FCA2; Sun, 28 Mar 2021 21:10:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B295560864; Sun, 28 Mar 2021 21:10:43 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id BBC9D4BB7C; Sun, 28 Mar 2021 21:10:39 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 12SLAc6x000922 for ; Sun, 28 Mar 2021 17:10:38 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7A0EB111284C; Sun, 28 Mar 2021 21:10:38 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast03.extmail.prod.ext.rdu2.redhat.com [10.11.55.19]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7581F1112842 for ; Sun, 28 Mar 2021 21:10:36 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4D37C811E7A for ; Sun, 28 Mar 2021 21:10:36 +0000 (UTC) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-184-al01fR5TMceq2gk7LBOAFQ-1; Sun, 28 Mar 2021 17:10:33 -0400 Received: by mail-ed1-f49.google.com with SMTP id x21so12081721eds.4 for ; Sun, 28 Mar 2021 14:10:33 -0700 (PDT) Received: from thinkbage.fritz.box (p200300d06f10a800c2d8328c30b6edfc.dip0.t-ipconnect.de. [2003:d0:6f10:a800:c2d8:328c:30b6:edfc]) by smtp.gmail.com with ESMTPSA id wr20sm7097654ejb.111.2021.03.28.14.10.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Mar 2021 14:10:32 -0700 (PDT) X-MC-Unique: 8N9BOK5QOaWg67D1kX1QTQ-1 X-MC-Unique: al01fR5TMceq2gk7LBOAFQ-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rZ11svgJNlE8FSsTmEEls3lHZlV5fm+5+uQfKJeQPRc=; b=J+GGl5sZ97vvbq8tuJAaV7XlDegf0hks7urGIT3Mm3SpCr6Qx9PQjxwlc0uRlXDjYD NHdKL5HfINsOJ2GJPhO8JiTvkXeDhUO5Grk9hnRW1bQACHT2eeklgm6aKqq/O2rzxR21 coCTXcMcicArtTKn7DoQjcDiw74sL/9M3zQGi4t0FKQZ759xjHPw/+GD2kKQ6CnkHsVA BynPVi0Xvz5VehiUb2O8hl5nWvJMEHkELDCEBk+Lc2LlnjRP9m3f1koRiGjykn3FsYny EIAghrAz/0xj8Pe0BxXbnc8gZc19SfYAJsidb166CYT7olniNQt7lmi15mxbve8dYu5n 5phA== X-Gm-Message-State: AOAM533hxLTtXhu3v/76wPAsIlDniprlXt8qkMa1eOgWpWIeWEvC6qsi XFV8/i1jim4EJvS1g0ZSZUChQ0+359jqqeuW X-Google-Smtp-Source: ABdhPJzYSUL04PwCvt85nbvd8BZmZ/tlyyRdx9x5R/y2XmVGvI1CE4kDo9TPP7l+KI2o7HvfsZy0Kg== X-Received: by 2002:aa7:cd54:: with SMTP id v20mr25815856edw.80.1616965832783; Sun, 28 Mar 2021 14:10:32 -0700 (PDT) From: Bastian Germann To: libvir-list@redhat.com Subject: [PATCH] rpc: libssh2: Enable EC host keys Date: Sun, 28 Mar 2021 23:10:21 +0200 Message-Id: <20210328211021.16932-1-bastiangermann@fishpost.de> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Bastian Germann X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" libssh2 has ECDSA and ED25519 support beginning with v1.9.0. libvirt cannot make use of those because it will handle them as unknown key types. Add support for those host key types. Signed-off-by: Bastian Germann Reviewed-by: Neal Gompa --- src/rpc/virnetsshsession.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/rpc/virnetsshsession.c b/src/rpc/virnetsshsession.c index fe77594..c311e90 100644 --- a/src/rpc/virnetsshsession.c +++ b/src/rpc/virnetsshsession.c @@ -389,7 +389,21 @@ virNetSSHCheckHostKey(virNetSSHSessionPtr sess) case LIBSSH2_HOSTKEY_TYPE_DSS: keyType =3D LIBSSH2_KNOWNHOST_KEY_SSHDSS; break; - +#ifdef LIBSSH2_HOSTKEY_TYPE_ED25519 + /* defs from libssh2 v1.9.0 or later */ + case LIBSSH2_HOSTKEY_TYPE_ECDSA_256: + keyType =3D LIBSSH2_KNOWNHOST_KEY_ECDSA_256; + break; + case LIBSSH2_HOSTKEY_TYPE_ECDSA_384: + keyType =3D LIBSSH2_KNOWNHOST_KEY_ECDSA_384; + break; + case LIBSSH2_HOSTKEY_TYPE_ECDSA_521: + keyType =3D LIBSSH2_KNOWNHOST_KEY_ECDSA_521; + break; + case LIBSSH2_HOSTKEY_TYPE_ED25519: + keyType =3D LIBSSH2_KNOWNHOST_KEY_ED25519; + break; +#endif case LIBSSH2_HOSTKEY_TYPE_UNKNOWN: default: virReportError(VIR_ERR_SSH, "%s", --=20 2.31.0