Skip to content

Commit

Permalink
Fix Windows build
Browse files Browse the repository at this point in the history
  • Loading branch information
mtrojnar committed Jan 26, 2025
1 parent 6dc51cf commit 3c7b2cc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 29 deletions.
1 change: 0 additions & 1 deletion src/eng_back.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include "engine.h"
#include "util.h"
#include "p11_pthread.h"
#include <stdio.h>
#include <string.h>

Expand Down
27 changes: 0 additions & 27 deletions src/engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,33 +104,6 @@ void ctx_log(ENGINE_CTX *ctx, int level, const char *format, ...)
#endif
;

/* TODO: move back to eng_back.c when references are removed from util_uri.c */
struct st_engine_ctx {
/* Engine configuration */
/*
* The PIN used for login. Cache for the ctx_get_pin function.
* The memory for this PIN is always owned internally,
* and may be freed as necessary. Before freeing, the PIN
* must be whitened, to prevent security holes.
*/
char *pin;
size_t pin_length;
int forced_pin;
int debug_level; /* level of debug output */
void (*vlog)(int, const char *, va_list); /* for the logging callback */
char *module;
char *init_args;
UI_METHOD *ui_method;
void *callback_data;
int force_login;
pthread_mutex_t lock;

/* Current operations */
PKCS11_CTX *pkcs11_ctx;
PKCS11_SLOT *slot_list;
unsigned int slot_count;
};

#endif /* _ENGINE_PKCS11_H */

/* vim: set noexpandtab: */
36 changes: 36 additions & 0 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include <openssl/x509.h>

typedef struct st_engine_ctx ENGINE_CTX; /* opaque */

/* defined in util_uri.c */

X509 *util_get_cert_from_uri(ENGINE_CTX *ctx, const char *object_uri,
Expand All @@ -32,3 +36,35 @@ EVP_PKEY *util_get_pubkey_from_uri(ENGINE_CTX *ctx, const char *s_key_id,

EVP_PKEY *util_get_privkey_from_uri(ENGINE_CTX *ctx, const char *s_key_id,
UI_METHOD *ui_method, void *callback_data);

/* TODO: move the following code back to eng_back.c as soon as
* all references to those fields are removed from util_uri.c */
#include "engine.h"
#include "p11_pthread.h"
struct st_engine_ctx {
/* Engine configuration */
/*
* The PIN used for login. Cache for the ctx_get_pin function.
* The memory for this PIN is always owned internally,
* and may be freed as necessary. Before freeing, the PIN
* must be whitened, to prevent security holes.
*/
char *pin;
size_t pin_length;
int forced_pin;
int debug_level; /* level of debug output */
void (*vlog)(int, const char *, va_list); /* for the logging callback */
char *module;
char *init_args;
UI_METHOD *ui_method;
void *callback_data;
int force_login;
pthread_mutex_t lock;

/* Current operations */
PKCS11_CTX *pkcs11_ctx;
PKCS11_SLOT *slot_list;
unsigned int slot_count;
};

/* vim: set noexpandtab: */
2 changes: 1 addition & 1 deletion src/util_uri.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "engine.h"
#include "util.h"
#include <stdio.h>
#include <string.h>

Expand Down

0 comments on commit 3c7b2cc

Please sign in to comment.