Skip to content

Commit

Permalink
add CONF_get1_default_config_file as a noop
Browse files Browse the repository at this point in the history
  • Loading branch information
samuel40791765 committed May 8, 2024
1 parent 0f67db8 commit 2d6b105
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 2 deletions.
12 changes: 12 additions & 0 deletions crypto/conf/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,18 @@ int CONF_modules_load_file(const char *filename, const char *appname,
return 1;
}

char *CONF_get1_default_config_file(void) {
const char *temp = "No support for Config files in AWS-LC.";
size_t temp_len = strlen(temp);

char *ret = (char *)OPENSSL_malloc(temp_len);
if(ret == NULL) {
OPENSSL_PUT_ERROR(CONF, ERR_R_MALLOC_FAILURE);
}
OPENSSL_memcpy(ret, temp, temp_len);
return ret;
}

void CONF_modules_free(void) {}

void CONF_modules_unload(int all) {}
Expand Down
12 changes: 10 additions & 2 deletions docs/porting/functionality-differences.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,10 +480,10 @@ Older and less common usages of `EVP_PKEY` have been removed. For example, signi
</td>
</tr>
<tr>
<td rowspan=4>
<td rowspan=5>
<p><span>CONF modules</span></p>
</td>
<td rowspan=4>
<td rowspan=5>
<p>
<span>
<a href="https://github.com/aws/aws-lc/blob/746d06505b3a3827cf61959ca0c3d87c3f21accc/include/openssl/conf.h#L127-L149">
Expand All @@ -498,6 +498,14 @@ Older and less common usages of `EVP_PKEY` have been removed. For example, signi
<td>
<p><span>Returns one.</span></p>
</td>
</tr>
<tr>
<td>
<p><span>CONF_get1_default_config_file</span></p>
</td>
<td>
<p><span>Returns a fixed dummy string(&quot;</span>No support for Config files in AWS-LC.&quot;)</p>
</td>
</tr>
<tr>
<td>
Expand Down
4 changes: 4 additions & 0 deletions include/openssl/conf.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@ OPENSSL_EXPORT const char *NCONF_get_string(const CONF *conf,
OPENSSL_EXPORT OPENSSL_DEPRECATED int CONF_modules_load_file(
const char *filename, const char *appname, unsigned long flags);

// CONF_get1_default_config_file returns a fixed dummy string. AWS-LC is defined
// to have no config file options.
OPENSSL_EXPORT OPENSSL_DEPRECATED char *CONF_get1_default_config_file(void);

// CONF_modules_free does nothing.
OPENSSL_EXPORT OPENSSL_DEPRECATED void CONF_modules_free(void);

Expand Down

0 comments on commit 2d6b105

Please sign in to comment.