The nonce has the format b64(time)+hash . */
| 1108 | /* The nonce has the format b64(time)+hash . |
| 1109 | */ |
| 1110 | static const char *gen_nonce(apr_pool_t *p, apr_time_t now, const char *opaque, |
| 1111 | const server_rec *server, |
| 1112 | const digest_config_rec *conf) |
| 1113 | { |
| 1114 | char *nonce = apr_palloc(p, NONCE_LEN+1); |
| 1115 | time_rec t; |
| 1116 | |
| 1117 | if (conf->nonce_lifetime != 0) { |
| 1118 | t.time = now; |
| 1119 | } |
| 1120 | else if (otn_counter) { |
| 1121 | /* this counter is not synch'd, because it doesn't really matter |
| 1122 | * if it counts exactly. |
| 1123 | */ |
| 1124 | t.time = (*otn_counter)++; |
| 1125 | } |
| 1126 | else { |
| 1127 | /* XXX: WHAT IS THIS CONSTANT? */ |
| 1128 | t.time = 42; |
| 1129 | } |
| 1130 | apr_base64_encode_binary(nonce, t.arr, sizeof(t.arr)); |
| 1131 | gen_nonce_hash(nonce+NONCE_TIME_LEN, nonce, opaque, server, conf); |
| 1132 | |
| 1133 | return nonce; |
| 1134 | } |
| 1135 | |
| 1136 | |
| 1137 | /* |
no test coverage detected