From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=in.ibm.com (client-ip=148.163.156.1; helo=mx0a-001b2d01.pphosted.com; envelope-from=devenrao@in.ibm.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=in.ibm.com Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 48cnGz0MkNzDqC3 for ; Wed, 11 Mar 2020 20:49:08 +1100 (AEDT) Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 02B9iCIG044626 for ; Wed, 11 Mar 2020 05:49:06 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.75]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ypw1bjeag-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 11 Mar 2020 05:49:06 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Wed, 11 Mar 2020 09:49:05 -0000 Received: from us1a3-smtp05.a3.dal06.isc4sb.com (10.146.71.159) by smtp.notes.na.collabserv.com (10.106.227.123) with smtp.notes.na.collabserv.com ESMTP; Wed, 11 Mar 2020 09:49:02 -0000 Received: from us1a3-mail121.a3.dal06.isc4sb.com ([10.146.45.16]) by us1a3-smtp05.a3.dal06.isc4sb.com with ESMTP id 2020031109490253-251643 ; Wed, 11 Mar 2020 09:49:02 +0000 In-Reply-To: Subject: Uploading authority certificate with expiry date beyond 2038 From: "Devender Rao" To: openbmc@lists.ozlabs.org Date: Wed, 11 Mar 2020 09:49:02 +0000 Sensitivity: References: MIME-Version: 1.0 Importance: Normal X-Priority: 3 (Normal) X-Mailer: IBM Verse Build 17652-1661 | IBM Domino Build SCN1812108_20180501T0841_FP62 November 04, 2019 at 09:47 X-LLNOutbound: False X-Disclaimed: 31983 X-TNEFEvaluated: 1 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=UTF-8 x-cbid: 20031109-6875-0000-0000-000002066620 X-IBM-SpamModules-Scores: BY=0.283702; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.434296; ST=0; TS=0; UL=0; ISC=; MB=0.090638 X-IBM-SpamModules-Versions: BY=3.00012727; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000293; SDB=6.01346055; UDB=6.00717714; IPR=6.01128467; MB=3.00031174; MTD=3.00000008; XFM=3.00000015; UTC=2020-03-11 09:49:03 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2020-03-11 07:28:05 - 6.00011105 x-cbparentid: 20031109-6876-0000-0000-0000031F69D5 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-03-11_02:2020-03-10, 2020-03-11 signatures=0 X-Proofpoint-Spam-Reason: safe X-BeenThere: openbmc@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development list for OpenBMC List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Mar 2020 09:49:15 -0000
Hi,
 
I am having an issue where the user uploads a certific= ate with validity period of 25 years which turns out to be year 2045. But the expiry date value wr= aps around due to overf= low and the final time generated is year 1908. Time value is represented as number of seconds sinc= e the start of the Unix epoch. This happens when certificates are listed in GUI by fetching the p= roperties using Redfish (https://github.com/openbmc/bmcweb/blob/master/redfish-core/lib/certif= icate=5Fservice.hpp#L659)

As time=5Ft data structure is defin= ed as int32 it can hold up to a maximum value of 2147483647 which covers certificate validity up t= o 2038.

Any certificate which is uploaded with expiry year= greater than 2038, the seconds value in time=5Ft wraps around and will generate a negative value,= which when used expiry= date value will be less than 1970.

Example:
Mar 10 15:03:49= w5 bmcweb[170]: bmcweb not after 2366947077
Mar 10 15:03:49 w5 bmcweb[1= 70]: bmcweb not after 1908-11-26T22:49:41+00:00
 
Probable solutions
1) Do nothing as the cha= nces of uploading a certificate with expiry date > 18 chances never happ= en
2) Return error to the caller if the expirty date is greater than 2038.

Would l= ike community feedback on this