Message ID | 20231126132417.107606-2-Michael.Glembotzki@iris-sensing.com |
---|---|
State | Changes Requested |
Headers | show
Return-Path: <swupdate+bncBDY5JUXLVIEBBJUORWVQMGQEBXRG4WI@googlegroups.com> X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=googlegroups.com header.i=@googlegroups.com header.a=rsa-sha256 header.s=20230601 header.b=l4IYCTL7; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=LFQIYE2+; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=googlegroups.com (client-ip=2a00:1450:4864:20::13b; helo=mail-lf1-x13b.google.com; envelope-from=swupdate+bncbdy5juxlviebbjuorwvqmgqebxrg4wi@googlegroups.com; receiver=patchwork.ozlabs.org) Received: from mail-lf1-x13b.google.com (mail-lf1-x13b.google.com [IPv6:2a00:1450:4864:20::13b]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4SdTwZ1T4Pz1ySj for <incoming@patchwork.ozlabs.org>; Mon, 27 Nov 2023 00:25:00 +1100 (AEDT) Received: by mail-lf1-x13b.google.com with SMTP id 2adb3069b0e04-50aa822cb33sf3143752e87.0 for <incoming@patchwork.ozlabs.org>; Sun, 26 Nov 2023 05:25:00 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701005095; cv=pass; d=google.com; s=arc-20160816; b=sduZV40bnsVX5fLuWTNro1WnQkspUTUmZhQETT3IwdADLi3toGP9wLWYQHTrqFmB1l SeSTBKZSdlltTOVyu8XSDh9QGBkHpvZg5RfkQqxrQZtPOfLExXqxlpks3ZCF/jb4K04a 3Y3loiMJc5HBC8d41tyU6GsSWPefaijcT4sWLDO0ttVKEbQEoR8fWdCMyoRa53wsjiCE /KA9UGQvB7AgoPKoCz43rxQv2eWcIGARNivKX1/T0tAJpww82C6NnZ6wDBqvHWx51nXy 5C5B7wm7u8QXI2qn0fYBHEmaDaFAOmQH7Zq/QyAqxc6FSQWRFvN4b5Q0gJhDfNN0P4oQ 7QIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:dkim-signature :dkim-signature; bh=VD8tc+TySmQdY2HpBEihlPV2pITy4yxGzI0JpsJb0pE=; fh=zydHuzCQWrku2OPQyZfraJZFcOpEXLQ/YBcu3QNiBd0=; b=k9DuDDLOfpNlJW7PmpWn50Of+dejfLVmfZJcpAyJ2DSMrfZ0R7kY8I7Wpp6pFMqNNN R9y3RywmpgvLFpU1WQ3STR31sqXvAVSAu7BZFa4iVNC5duYO9n0nPGx3vYhWVMpIEVRQ lSBInBDEOmEgDKGfh0KPs7Frbui06qWnrIXJu9sH1ikXWlrs/yX+P9o2IpuFgwSwhWcj Osfbn9mxW7aAJCQdeWjtwIkSzpn6PR/heMKG/2pHkuupf7PrCSZCuvz1y8dyVQtVmZBf KfaCk6El6CA2t6fxBPReBB8jXs62+7IGD7w44/ybVc2Kvn2r9eYfSe8dmBfGR1vf3zCu eFCA== ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ewpbEZt+; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1701005095; x=1701609895; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:sender:from:to:cc:subject:date:message-id :reply-to; bh=VD8tc+TySmQdY2HpBEihlPV2pITy4yxGzI0JpsJb0pE=; b=l4IYCTL7NB/CfjMTrVCRcO46KmZRr3M1zXupIVMtUdP62n2lGO5vjeWd3B1S5GnSb7 sVxBciwJuXAMSaooulXoGmjC5mhA63la99kZ5Xzqckud384dr+M42b0GgVlpNsFuZ9W0 nIFoOkrP1/Q2bamcPq3qv1x/4q79HHOSMYovy4D/wZQAnSqgeKpD4e0aTH5sANNUXRuF Y9P54eckxp85DohZrMVIHyc/Kxq3EiOjCk/KFpymiDM5r6V2GzSgmQEukIRwsglu+3GF Ck+QBYe8W1V0EqKrigK/hz5QL2KwtJnzByDksMbwvAYwIdrmboNSKQNDPnUsDyYxVAAC 6wng== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701005095; x=1701609895; darn=patchwork.ozlabs.org; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=VD8tc+TySmQdY2HpBEihlPV2pITy4yxGzI0JpsJb0pE=; b=LFQIYE2+VX6UuZdZbbDMeC7GQHhlnrs1p/ESqzeb8zHTUCCM/RIMDKqrZfs6/HJNel mkuCwcpFuNJSN6Cpw0oYVMvIAN8NMLyTHxKoAm5s/aInA78fYDKLzHN4+d40GQTbIvYH khtFiTE/D8QC6zkcw6c/yHbe/Ih5xE7+15sgSapdqXrF/crhGqQLq8gEBn19po7Wjw27 IM1qiwOZPXHRn/R5Y3a4VO4unIGD0fSOvJ/NeVlz29NFXMe7wVCJYfZLHdYhwO25q1hJ rs3dDBXaaA9QkKU+7iiEy2+jwtnZcf0hw1GxJzUepqMA3g/xCIVWgJAP6pSPka0THZqS /S7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701005095; x=1701609895; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :x-spam-checked-in-group:list-id:mailing-list:precedence :x-original-authentication-results:x-original-sender:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=VD8tc+TySmQdY2HpBEihlPV2pITy4yxGzI0JpsJb0pE=; b=rEPp8+qr32oZbEoReDwF5OwMcrAP5AzTYtu1Jy4EXvXp1e6J0XXgWgmn90vVDmMPa4 cmyX1byo0y34uewiLqd8DSO8Py1IdUADiTg2OFWg/6JBJD8VCzNkIDSFEEaBaTGMFy/T Jwiph5ZjQq6JVp9AdQS71J1GiphttPB44fzweFbgRkijAbuwudfzQKG2dDhUzB2IgQZP /+hipQVb2pKGAYCqX5MwwjTsjVU9+47WU3JeZ9IwCy3t4PXrwfVtIDsOj3ddnatlaCHj Kw3BRs6e7OFldKn6hhsSMO2BrZKU77v5aR3Tatk1hxYwVhNUKRAT6/7nDPELwpgGJ0D8 fR+g== Sender: swupdate@googlegroups.com X-Gm-Message-State: AOJu0YwUUiTcqXpCWkI9iYTUQCmMk4XsIp/wCD34HQ7gFyt8iBJdVnYu jShghORYYcpP0rXrspuX0WY= X-Google-Smtp-Source: AGHT+IHjM9wEWCKCRHk+mwlQ8AZ1iZSBcWcR0Xc0tZGDiVIwvci8fTyF/lVvVAJ3p9+W+noK5ps/yA== X-Received: by 2002:a2e:840b:0:b0:2c6:f711:cea1 with SMTP id z11-20020a2e840b000000b002c6f711cea1mr6110642ljg.39.1701005095028; Sun, 26 Nov 2023 05:24:55 -0800 (PST) X-BeenThere: swupdate@googlegroups.com Received: by 2002:a2e:a4a2:0:b0:2c8:80ff:6090 with SMTP id g2-20020a2ea4a2000000b002c880ff6090ls605357ljm.1.-pod-prod-01-eu; Sun, 26 Nov 2023 05:24:52 -0800 (PST) X-Received: by 2002:a2e:a107:0:b0:2c9:9805:cc8c with SMTP id s7-20020a2ea107000000b002c99805cc8cmr2820935ljl.8.1701005092554; Sun, 26 Nov 2023 05:24:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701005092; cv=none; d=google.com; s=arc-20160816; b=eLvnhhqC4/pvFmdCdc1BxxUsLqOm8m0R6tWmeGPETxAeV2hBMsVTMbu/YNpdpWpZdA CM+1t6pxpJo8RRAfaz6P6g7b+UjiBs5THYrBvbtv4tasIlRmwOPU0qtO5oEzG9wezvwe hhE/RPYkx9oktuh0m0O5miGQgIk+V88kV7twJSqM6tGGHDWkqp2GfweRegppLjMgMjH1 E9Pijbt8cXVZiSnI9MAKA6/HqLPYL3NhZsYUzxA9bSEFOro03oRwaxuNY4MAk66ZvEG2 IlqK8BkeeGhGDffSR8NCR+5EGGjbXXBn8oVpXq026mzBFyS84FUVfRaPom23niQL06Ry tNjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=VMJe6stex9qk7qIO3BL4piM3y0WgRj18eZBy/eomo2U=; fh=zydHuzCQWrku2OPQyZfraJZFcOpEXLQ/YBcu3QNiBd0=; b=xn145YT46+LH0huo4HdWjzdy+kRSa6FryYeWAQAjDsrwIt2zMfDeuX5Bq5oNydS9BN q/HqvzNhYu5ZBPbfNq+ZPRf7t31IiU1yM8TzY4vfgkhhDp2hbfnxjnlF5d4Do9u6nQmn 0goLLht6LGXi6KB8Ny5i+tnuEUa/xBnljmX0zD/Q8P4h7fB3QvP8+E9WdwoY7gh9LsbM 2ZQXadf1zzu9wnvL8XvK/oAGERra4wQI2itZyRHweSy1tfm/jV1Bi8W/vzWh0hYJLyCN ne9ekM10wViGIlLvDePAvlvNPPE9U5D28Ip3uwimVDTdZXXuGXDY5lrFLXpHYHhqGWQ2 SuEA== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ewpbEZt+; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com. [2a00:1450:4864:20::62b]) by gmr-mx.google.com with ESMTPS id l24-20020a2ea318000000b002c9a0aa6a53si31808lje.3.2023.11.26.05.24.52 for <swupdate@googlegroups.com> (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Nov 2023 05:24:52 -0800 (PST) Received-SPF: pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62b as permitted sender) client-ip=2a00:1450:4864:20::62b; Received: by mail-ej1-x62b.google.com with SMTP id a640c23a62f3a-9fa45e75ed9so461998066b.1 for <swupdate@googlegroups.com>; Sun, 26 Nov 2023 05:24:52 -0800 (PST) X-Received: by 2002:a17:907:d30c:b0:9ae:699d:8a2a with SMTP id vg12-20020a170907d30c00b009ae699d8a2amr7883697ejc.5.1701005091512; Sun, 26 Nov 2023 05:24:51 -0800 (PST) Received: from PC-2635.irisgmbh.local (dslb-002-203-161-041.002.203.pools.vodafone-ip.de. [2.203.161.41]) by smtp.gmail.com with ESMTPSA id h18-20020a1709063b5200b009fdd2c6d042sm4630799ejf.148.2023.11.26.05.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 Nov 2023 05:24:51 -0800 (PST) From: Michael Glembotzki <m.glembo@gmail.com> To: swupdate@googlegroups.com Cc: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com> Subject: [swupdate] [PATCH 2/3] util: Add support for clearing the aes decryption key Date: Sun, 26 Nov 2023 14:24:16 +0100 Message-ID: <20231126132417.107606-2-Michael.Glembotzki@iris-sensing.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231126132417.107606-1-Michael.Glembotzki@iris-sensing.com> References: <20231126132417.107606-1-Michael.Glembotzki@iris-sensing.com> MIME-Version: 1.0 X-Original-Sender: m.glembo@gmail.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ewpbEZt+; spf=pass (google.com: domain of m.glembo@gmail.com designates 2a00:1450:4864:20::62b as permitted sender) smtp.mailfrom=m.glembo@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list swupdate@googlegroups.com; contact swupdate+owners@googlegroups.com List-ID: <swupdate.googlegroups.com> X-Spam-Checked-In-Group: swupdate@googlegroups.com X-Google-Group-Id: 605343134186 List-Post: <https://groups.google.com/group/swupdate/post>, <mailto:swupdate@googlegroups.com> List-Help: <https://groups.google.com/support/>, <mailto:swupdate+help@googlegroups.com> List-Archive: <https://groups.google.com/group/swupdate List-Subscribe: <https://groups.google.com/group/swupdate/subscribe>, <mailto:swupdate+subscribe@googlegroups.com> List-Unsubscribe: <mailto:googlegroups-manage+605343134186+unsubscribe@googlegroups.com>, <https://groups.google.com/group/swupdate/subscribe> |
Series |
[1/3] Add support for asymmetric decryption
|
expand
|
diff --git a/core/util.c b/core/util.c index cb2cf78..ef51d9e 100644 --- a/core/util.c +++ b/core/util.c @@ -563,6 +563,20 @@ int set_aes_key(const char *key, const char *ivt) return 0; } +void clear_aes_key(void) { + if (!aes_key) { + return; + } +#ifdef CONFIG_PKCS11 + free(aes_key->key); + aes_key->key = NULL; +#else + memset(aes_key->key, 0, sizeof(aes_key->key)); +#endif + memset(aes_key->ivt, 0, sizeof(aes_key->ivt)); + aes_key->keylen = 0; +} + const char *get_fwenv_config(void) { if (!fwenv_config) #if defined(CONFIG_UBOOT) diff --git a/include/util.h b/include/util.h index dc0b957..ad7a6b7 100644 --- a/include/util.h +++ b/include/util.h @@ -243,6 +243,7 @@ unsigned char *get_aes_key(void); char get_aes_keylen(void); unsigned char *get_aes_ivt(void); int set_aes_key(const char *key, const char *ivt); +void clear_aes_key(void); /* Getting global information */ int get_install_info(sourcetype *source, char *buf, size_t len);
Signed-off-by: Michael Glembotzki <Michael.Glembotzki@iris-sensing.com> --- core/util.c | 14 ++++++++++++++ include/util.h | 1 + 2 files changed, 15 insertions(+)