@@ -8421,7 +8421,7 @@ static word32 NextCert(byte* data, word32 length, word32* idx)
84218421 return len ;
84228422}
84238423
8424- #if defined(HAVE_CERTIFICATE_STATUS_REQUEST )
8424+ #if defined(HAVE_CERTIFICATE_STATUS_REQUEST ) && !defined( NO_WOLFSSL_SERVER )
84258425/* Write certificate status request into certificate to buffer.
84268426 *
84278427 * ssl SSL/TLS object.
@@ -8546,7 +8546,7 @@ static int SendTls13Certificate(WOLFSSL* ssl)
85468546{
85478547 int ret = 0 ;
85488548 word32 certSz , certChainSz , headerSz , listSz , payloadSz ;
8549- word16 extSz [1 + MAX_CERT_EXTENSIONS ];
8549+ word16 extSz [MAX_CERT_EXTENSIONS ];
85508550 word16 extIdx = 0 ;
85518551 word32 maxFragment ;
85528552 word32 totalextSz = 0 ;
@@ -8614,7 +8614,7 @@ static int SendTls13Certificate(WOLFSSL* ssl)
86148614 for (extIdx = 0 ; extIdx < (word16 )XELEM_CNT (extSz ); extIdx ++ )
86158615 extSz [extIdx ] = OPAQUE16_LEN ;
86168616
8617- #if defined(HAVE_CERTIFICATE_STATUS_REQUEST )
8617+ #if defined(HAVE_CERTIFICATE_STATUS_REQUEST ) && !defined( NO_WOLFSSL_SERVER )
86188618 /* We only send CSR on the server side. On client side, the CSR data
86198619 * is populated with the server response. We would be sending the server
86208620 * its own stapling data. */
@@ -8747,14 +8747,14 @@ static int SendTls13Certificate(WOLFSSL* ssl)
87478747 if (certSz > 0 && ssl -> fragOffset < certSz + extSz [0 ]) {
87488748 /* Put in the leaf certificate with extensions. */
87498749 word32 copySz = AddCertExt (ssl , ssl -> buffers .certificate -> buffer ,
8750- certSz , extSz [extIdx ], ssl -> fragOffset , fragSz ,
8751- output + i , extIdx );
8750+ certSz , extSz [0 ], ssl -> fragOffset , fragSz ,
8751+ output + i , 0 );
87528752 i += copySz ;
87538753 ssl -> fragOffset += copySz ;
87548754 length -= copySz ;
87558755 fragSz -= copySz ;
8756- if (ssl -> fragOffset == certSz + extSz [extIdx ])
8757- FreeDer (& ssl -> buffers .certExts [extIdx ]);
8756+ if (ssl -> fragOffset == certSz + extSz [0 ])
8757+ FreeDer (& ssl -> buffers .certExts [0 ]);
87588758 }
87598759 }
87608760 if (certChainSz > 0 && fragSz > 0 ) {
@@ -8771,8 +8771,11 @@ static int SendTls13Certificate(WOLFSSL* ssl)
87718771 ssl -> buffers .certChain -> length , & idx );
87728772 if (len == 0 )
87738773 break ;
8774+ #if defined(HAVE_CERTIFICATE_STATUS_REQUEST ) && \
8775+ !defined(NO_WOLFSSL_SERVER )
87748776 if (MAX_CERT_EXTENSIONS > extIdx )
87758777 extIdx ++ ;
8778+ #endif
87768779 }
87778780 /* Write out certificate and extension. */
87788781 l = AddCertExt (ssl , p , len , extSz [extIdx ], offset , fragSz ,
0 commit comments