@@ -1148,15 +1148,23 @@ nist_algs$(EXESUFX): nist_algs1$(OBJSUFX)
11481148
11491149# =============================== Code sign/verify ==============================
11501150
1151+ # Note that the signing key should be present - supplied by the build, not in repo.
1152+ # this shows how one can be generated if required.
1153+
11511154# - stand alone signing tool
11521155privkey.rsa :
11531156 $(OPENSSL_PATH_SETUP ) $(REALOPENSSL ) genrsa -out privkey.rsa 2048
11541157
1158+ # matching public key for signature checking
1159+ # this shows how one can be derived from the private key if required.
1160+ # include sanity check because ZOSa can muck up this file
1161+
11551162pubkey.h : privkey.rsa
11561163 $(OPENSSL_PATH_SETUP ) $(REALOPENSSL ) rsa -in privkey.rsa -outform PEM -RSAPublicKey_out > rsa_pub_key.pem
11571164 perl pem2c.pl rsa_pub_key.pem > pubkey.h
1158- rm rsa_pub_key.pem
11591165 cat pubkey.h
1166+ grep " 0x30,0x82," pubkey.h
1167+ rm rsa_pub_key.pem
11601168
11611169signer$(OBJSUFX ) : extsig.c
11621170 $(CC ) -DSTANDALONE -DOPSYS=\" $(OPSYS ) \" $(CFLAGS ) -I$(OSSLINC_DIR ) extsig.c $(OUT ) $@
@@ -1177,7 +1185,10 @@ status$(OBJSUFX): status.c status.h icclib.h
11771185 $(CC ) $(CFLAGS ) -I$(SDK_DIR ) -I$(OSSLINC_DIR ) -I$(OSSL_DIR ) -I$(API_DIR ) status.c
11781186
11791187# - Build ICC FIPS code
1188+ # include a sanity check for the pubkey.h include file - should be DER encoding - we can get a broken one on ZOSa
11801189fips$(OBJSUFX ) : pubkey.h fips.c fips.h icclib.h iccerr.h $(PRNG_DIR ) /fips-prng-RAND.h tracer.h
1190+ cat pubkey.h
1191+ grep " 0x30,0x82," pubkey.h
11811192 $(CC ) $(CFLAGS ) -I./ -I$(SDK_DIR ) -I$(OSSLINC_DIR ) -I$(OSSL_DIR ) -I$(API_DIR ) fips.c
11821193
11831194# - Compile the FIPS prng code
0 commit comments