Skip to content

Commit

Permalink
Small cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
philljj committed Aug 30, 2024
1 parent 7752d07 commit 369e6a5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 22 deletions.
17 changes: 8 additions & 9 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -13217,7 +13217,14 @@ int CopyDecodedToX509(WOLFSSL_X509* x509, DecodedCert* dCert)
#endif /* KEEP_PEER_CERT || SESSION_CERTS */

#if defined(WOLFSSL_ACERT)
/* Copy parts X509 needs from Decoded cert, 0 on success */
/* Copy a DecodedAcert structure to an X509_ACERT.
*
* @param [out] x509 the dst X509 acert structure
* @param [in] dAcert the src decoded acert structure
*
* @return 0 on success
* @return < 0 on error
* */
int CopyDecodedAcertToX509(WOLFSSL_X509_ACERT* x509, DecodedAcert* dAcert)
{
int ret = 0;
Expand Down Expand Up @@ -13277,14 +13284,6 @@ int CopyDecodedAcertToX509(WOLFSSL_X509_ACERT* x509, DecodedAcert* dAcert)
x509->sig.length = dAcert->sigLength;
x509->sigOID = (int)dAcert->signatureOID;
}
#if defined(OPENSSL_ALL)
wolfSSL_ASN1_OBJECT_free(x509->algor.algorithm);
if (!(x509->algor.algorithm =
wolfSSL_OBJ_nid2obj(oid2nid(dAcert->signatureOID, oidSigType)))) {
ret = PUBLIC_KEY_E;
WOLFSSL_ERROR_VERBOSE(ret);
}
#endif
}

/* if der contains original source buffer then store for potential
Expand Down
15 changes: 2 additions & 13 deletions wolfcrypt/src/asn.c
Original file line number Diff line number Diff line change
Expand Up @@ -40375,13 +40375,6 @@ static int DecodeAcertGeneralName(const byte* input, word32* inOutIdx, byte tag,
}
#endif
#endif /* IGNORE_NAME_CONSTRAINTS */
#if defined(WOLFSSL_SEP) || defined(WOLFSSL_FPKI)
/* GeneralName choice: otherName */
else if (tag == (ASN_CONTEXT_SPECIFIC | ASN_CONSTRUCTED | ASN_OTHER_TYPE)) {
/* TODO: test data for code path */
ret = DecodeOtherName(cert, input, &idx, idx + (word32)len);
}
#endif
/* GeneralName choice: dNSName, x400Address, ediPartyName */
else {
WOLFSSL_MSG("\tUnsupported name type, skipping");
Expand Down Expand Up @@ -40478,8 +40471,6 @@ static int DecodeAcertGeneralNames(const byte* input, word32 sz, DecodedAcert* c
* serial CertificateSerialNumber,
* issuerUID UniqueIdentifier OPTIONAL
* }
*
*
* */
static const ASNItem HolderASN[] =
{
Expand Down Expand Up @@ -40600,7 +40591,6 @@ static int DecodeHolder(const byte* input, word32 len, DecodedAcert* cert)
* names. ACs conforming to this profile MUST omit the
* baseCertificateID and objectDigestInfo fields.
*
*
* 4.1. X.509 Attribute Certificate Definition
*
* AttCertIssuer ::= CHOICE {
Expand All @@ -40617,7 +40607,6 @@ static int DecodeHolder(const byte* input, word32 len, DecodedAcert* cert)
* -- baseCertificateID and objectDigestInfo MUST
* -- NOT be present in this profile
* }
*
* */
static const ASNItem AttCertIssuerASN[] =
{
Expand Down Expand Up @@ -40646,7 +40635,8 @@ enum {
* @return ASN_UNKNOWN_OID_E when the OID cannot be verified.
* @return MEMORY_E when dynamic memory allocation fails.
* */
static int DecodeAttCertIssuer(const byte* input, word32 len, DecodedAcert* cert)
static int DecodeAttCertIssuer(const byte* input, word32 len,
DecodedAcert* cert)
{
DECL_ASNGETDATA(dataASN, AttCertIssuerASN_Length);
int ret = 0;
Expand Down Expand Up @@ -40799,7 +40789,6 @@ enum {
* - extensions
* - attributes
*
*
* Returns 0 on success.
* Returns negative error code on error/failure.
* */
Expand Down

0 comments on commit 369e6a5

Please sign in to comment.