-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move 3 functions to the appropriate util module. #34
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -99,19 +99,6 @@ int CERTS_save(OPTIONAL const STACK_OF(X509) *certs, const char *file, OPTIONAL | |
void CERTS_free(OPTIONAL STACK_OF(X509) *certs); | ||
|
||
|
||
/*!***************************************************************************** | ||
* @brief parse an X.500 Distinguished Name (DN) | ||
* | ||
* @param dn string to be parsed, format "/type0=value0/type1=value1/type2=..." where characters may be escaped by '\'. | ||
* The NULL-DN may be given as "/" or "". | ||
* @param chtype type of the string, e.g., MBSTRING_ASC, as defined in openssl/asn1.h | ||
* @param multirdn flag whether to allow multi-valued RDNs | ||
* @return ASN.1 representation of the DN, or null on error | ||
*******************************************************************************/ | ||
/* this function is used by the genCMPClient API implementation */ | ||
X509_NAME* UTIL_parse_name(const char* dn, long chtype, bool multirdn); | ||
|
||
|
||
/*!***************************************************************************** | ||
* @brief log messsage about the given certificate, printing its subject | ||
* | ||
|
@@ -177,30 +164,4 @@ bool CERT_check_all(const char *uri, OPTIONAL STACK_OF(X509) *certs, int type_CA | |
OPTIONAL const X509_VERIFY_PARAM *vpm); | ||
|
||
|
||
/*!***************************************************************************** | ||
* @brief add certificate to given stack, optionally only if not already contained | ||
* | ||
* @param sk stack of certificates | ||
* @param cert certificate to be pushed to the stack | ||
* @param no_duplicate flag governing whether to add cert if it is a duplicate | ||
* @return true on success, else false | ||
*******************************************************************************/ | ||
bool UTIL_sk_X509_add1_cert(STACK_OF(X509) * sk, X509* cert, bool no_duplicate); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I acknowledge the discrepancy between the name and the location of the function, |
||
|
||
|
||
/*!***************************************************************************** | ||
* @brief add stack of certificates to given stack, | ||
* optionally only if not self-signed and optionally if not already contained | ||
* | ||
* @param sk stack of certificates | ||
* @param certs (optional) stack of certificates to be pushed to the stack | ||
* @param no_self_signed flag governing whether to add self-signed certs | ||
* @param no_duplicates flag governing whether to add cert if it is a duplicate | ||
* @return true on success, else false | ||
*******************************************************************************/ | ||
/* this function is used by the genCMPClient API implementation */ | ||
int UTIL_sk_X509_add1_certs(STACK_OF(X509) * sk, OPTIONAL const STACK_OF(X509) * certs, int no_self_signed, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I acknowledge the discrepancy between the name and the location of the function, |
||
int no_duplicates); | ||
|
||
|
||
#endif /* SECUTILS_CERT_H_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I acknowledge the discrepancy between the name and the location of the function,
but better not move it to UTIL, which is meant just for stuff that does not fit better elsewhere.
Instead, just rename the function to include
CERT
rather thanUTIL_
.