Skip to content

Commit 5b24dbf

Browse files
author
Hans Zandbelt
committed
release 1.8.4: compile with MS VS 2013
1 parent cf8c18d commit 5b24dbf

File tree

11 files changed

+45
-8
lines changed

11 files changed

+45
-8
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
7/3/2015
2+
- allow for compilation on Windows using VS 2013
3+
- bump to 1.8.4
4+
15
6/30/2015
26
- improve memcache logging: don't report cache misses as an error, thanks to @scottdear
37
- work around JSON timestamp print modifier issue (%lld) on some platforms, thanks to @ralphvanetten

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([mod_auth_openidc],[1.8.4rc3],[[email protected]])
1+
AC_INIT([mod_auth_openidc],[1.8.4],[[email protected]])
22

33
AC_SUBST(NAMEVER, AC_PACKAGE_TARNAME()-AC_PACKAGE_VERSION())
44

debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
libapache2-mod-auth-openidc (1.8.4-1) unstable; urgency=medium
2+
3+
* allow for compilation on MS Windows
4+
5+
-- Hans Zandbelt <[email protected]> Fri, 03 Jul 2015 19:39:11 +0200
6+
17
libapache2-mod-auth-openidc (1.8.3-1) unstable; urgency=medium
28

39
* remove accounts.google.com exceptions

src/cache/lock.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
* @Author: Hans Zandbelt - [email protected]
5151
*/
5252

53+
#ifndef WIN32
5354
#include <unistd.h>
55+
#endif
5456

5557
#include "apr_general.h"
5658

src/config.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static const char *oidc_set_public_key_files(cmd_parms *cmd, void *struct_ptr,
528528
cmd->server->module_config, &auth_openidc_module);
529529

530530
int offset = (int) (long) cmd->info;
531-
apr_hash_t **public_keys = (apr_hash_t **) ((void *) cfg + offset);
531+
apr_hash_t **public_keys = (apr_hash_t **) ((char *) cfg + offset);
532532

533533
if (apr_jwk_parse_rsa_public_key(cmd->pool, arg, &jwk, &err) == FALSE) {
534534
return apr_psprintf(cmd->pool,
@@ -551,7 +551,7 @@ static const char *oidc_set_shared_keys(cmd_parms *cmd, void *struct_ptr,
551551
oidc_cfg *cfg = (oidc_cfg *) ap_get_module_config(
552552
cmd->server->module_config, &auth_openidc_module);
553553
int offset = (int) (long) cmd->info;
554-
apr_hash_t **shared_keys = (apr_hash_t **) ((void *) cfg + offset);
554+
apr_hash_t **shared_keys = (apr_hash_t **) ((char *) cfg + offset);
555555
*shared_keys = oidc_util_merge_symmetric_key(cmd->pool, *shared_keys, arg,
556556
NULL);
557557
return NULL;
@@ -702,7 +702,7 @@ static const char *oidc_set_remote_user_claim(cmd_parms *cmd, void *struct_ptr,
702702

703703
int offset = (int) (long) cmd->info;
704704
oidc_remote_user_claim_t *remote_user_claim =
705-
(oidc_remote_user_claim_t *) ((void *) cfg + offset);
705+
(oidc_remote_user_claim_t *) ((char *) cfg + offset);
706706

707707
remote_user_claim->claim_name = v1;
708708
if (v2)

src/jose/apr_jose.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
#ifndef _APR_JOSE_H_
5454
#define _APR_JOSE_H_
5555

56+
#include <stdint.h>
5657
#include "apr_pools.h"
5758
#include "apr_tables.h"
5859
#include "apr_hash.h"

src/jose/apr_jwt.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@
5555
#include "apr_jose.h"
5656
#include <openssl/opensslv.h>
5757

58+
#ifdef WIN32
59+
#define snprintf _snprintf
60+
#endif
61+
5862
/*
5963
* assemble an error report
6064
*/

src/mod_auth_openidc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,8 @@ static void oidc_scrub_request_headers(request_rec *r, const char *claim_prefix,
133133
r->headers_in = clean_headers;
134134
}
135135

136+
#define OIDC_SHA1_LEN 20
137+
136138
/*
137139
* calculates a hash value based on request fingerprint plus a provided nonce string.
138140
*/
@@ -172,13 +174,12 @@ static char *oidc_get_browser_state_hash(request_rec *r, const char *nonce) {
172174
apr_sha1_update(&sha1, nonce, strlen(nonce));
173175

174176
/* finalize the hash input and calculate the resulting hash output */
175-
const int sha1_len = 20;
176-
unsigned char hash[sha1_len];
177+
unsigned char hash[OIDC_SHA1_LEN];
177178
apr_sha1_final(hash, &sha1);
178179

179180
/* base64url-encode the resulting hash and return it */
180181
char *result = NULL;
181-
oidc_base64url_encode(r, &result, (const char *) hash, sha1_len, TRUE);
182+
oidc_base64url_encode(r, &result, (const char *) hash, OIDC_SHA1_LEN, TRUE);
182183
return result;
183184
}
184185

src/mod_auth_openidc.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#ifndef MOD_AUTH_OPENIDC_H_
5252
#define MOD_AUTH_OPENIDC_H_
5353

54+
#include <stdint.h>
5455
#include <openssl/evp.h>
5556
#include <apr_uri.h>
5657
#include <apr_uuid.h>
@@ -433,9 +434,10 @@ apr_byte_t oidc_metadata_get(request_rec *r, oidc_cfg *cfg, const char *selected
433434
apr_byte_t oidc_metadata_jwks_get(request_rec *r, oidc_cfg *cfg, const oidc_jwks_uri_t *jwks_uri, json_t **j_jwks, apr_byte_t *refresh);
434435

435436
// oidc_session.c
436-
#if MODULE_MAGIC_NUMBER_MAJOR >= 20081201
437+
#if MODULE_MAGIC_NUMBER_MAJOR_NOT_WORKING_YET >= 20081201
437438
// this stuff should make it easy to migrate to the post 2.3 mod_session infrastructure
438439
#include "mod_session.h"
440+
//#define OIDC_SESSION_USE_APACHE_SESSIONS 1
439441
#else
440442
typedef struct {
441443
apr_pool_t *pool; /* pool to be used for this session */

src/session.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ static char x2c(const char *what) {
172172
return (digit);
173173
}
174174

175+
#ifndef WIN32
175176
AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *copy, const char *buffer) {
176177
const unsigned char *s = (const unsigned char *) buffer;
177178
unsigned char *d = (unsigned char *) copy;
@@ -190,6 +191,7 @@ AP_DECLARE(char *) ap_escape_urlencoded_buffer(char *copy, const char *buffer) {
190191
*d = '\0';
191192
return copy;
192193
}
194+
#endif
193195

194196
static int oidc_session_unescape_url(char *url, const char *forbid,
195197
const char *reserved) {
@@ -240,6 +242,7 @@ static int oidc_session_unescape_url(char *url, const char *forbid,
240242
}
241243
}
242244

245+
#ifndef WIN32
243246
AP_DECLARE(int) ap_unescape_urlencoded(char *query) {
244247
char *slider;
245248
/* replace plus with a space */
@@ -253,6 +256,7 @@ AP_DECLARE(int) ap_unescape_urlencoded(char *query) {
253256
/* unescape everything else */
254257
return oidc_session_unescape_url(query, NULL, NULL);
255258
}
259+
#endif
256260

257261
// copied from mod_session.c
258262
static apr_status_t oidc_session_identity_decode(request_rec * r,

0 commit comments

Comments
 (0)