• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/openssl/test/

Lines Matching defs:test

88 } test[8] = {
90 "", 0, "More text test vectors to stuff up EBCDIC machines :-)", 54,
117 "", 0, "My test data", 12,
121 "", 0, "My test data", 12,
125 "123456", 6, "My test data", 12,
129 "12345", 5, "My test data again", 12,
149 printf("test skipped: MD5 disabled\n");
153 ebcdic2ascii(test[0].data, test[0].data, test[0].data_len);
154 ebcdic2ascii(test[1].data, test[1].data, test[1].data_len);
155 ebcdic2ascii(test[2].key, test[2].key, test[2].key_len);
156 ebcdic2ascii(test[2].data, test[2].data, test[2].data_len);
161 test[i].key, test[i].key_len,
162 test[i].data, test[i].data_len, NULL, NULL),
165 if (strcmp(p, (char *)test[i].digest) != 0) {
167 printf("got %s instead of %s\n", p, test[i].digest);
170 printf("test %d ok\n", i);
177 printf("Should fail to initialise HMAC with empty MD and key (test 4)\n");
181 if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
182 printf("Should fail HMAC_Update with ctx not set up (test 4)\n");
187 printf("Should fail to initialise HMAC with empty key (test 4)\n");
191 if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
192 printf("Should fail HMAC_Update with ctx not set up (test 4)\n");
196 printf("test 4 ok\n");
200 if (HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, NULL, NULL)) {
201 printf("Should fail to initialise HMAC with empty MD (test 5)\n");
205 if (HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
206 printf("Should fail HMAC_Update with ctx not set up (test 5)\n");
210 if (HMAC_Init_ex(&ctx, test[4].key, -1, EVP_sha1(), NULL)) {
211 printf("Should fail to initialise HMAC with invalid key len(test 5)\n");
215 if (!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha1(), NULL)) {
216 printf("Failed to initialise HMAC (test 5)\n");
220 if (!HMAC_Update(&ctx, test[4].data, test[4].data_len)) {
221 printf("Error updating HMAC with data (test 5)\n");
226 printf("Error finalising data (test 5)\n");
231 if (strcmp(p, (char *)test[4].digest) != 0) {
232 printf("Error calculating interim HMAC on test 5\n");
233 printf("got %s instead of %s\n", p, test[4].digest);
238 printf("Should disallow changing MD without a new key (test 5)\n");
242 if (!HMAC_Init_ex(&ctx, test[4].key, test[4].key_len, EVP_sha256(), NULL)) {
243 printf("Failed to reinitialise HMAC (test 5)\n");
247 if (!HMAC_Update(&ctx, test[5].data, test[5].data_len)) {
248 printf("Error updating HMAC with data (sha256) (test 5)\n");
253 printf("Error finalising data (sha256) (test 5)\n");
258 if (strcmp(p, (char *)test[5].digest) != 0) {
259 printf("Error calculating 2nd interim HMAC on test 5\n");
260 printf("got %s instead of %s\n", p, test[5].digest);
264 if (!HMAC_Init_ex(&ctx, test[6].key, test[6].key_len, NULL, NULL)) {
265 printf("Failed to reinitialise HMAC with key (test 5)\n");
269 if (!HMAC_Update(&ctx, test[6].data, test[6].data_len)) {
270 printf("Error updating HMAC with data (new key) (test 5)\n");
275 printf("Error finalising data (new key) (test 5)\n");
280 if (strcmp(p, (char *)test[6].digest) != 0) {
281 printf("error calculating HMAC on test 5\n");
282 printf("got %s instead of %s\n", p, test[6].digest);
285 printf("test 5 ok\n");
290 if (!HMAC_Init_ex(&ctx, test[7].key, test[7].key_len, EVP_sha1(), NULL)) {
291 printf("Failed to initialise HMAC (test 6)\n");
295 if (!HMAC_Update(&ctx, test[7].data, test[7].data_len)) {
296 printf("Error updating HMAC with data (test 6)\n");
301 printf("Failed to copy HMAC_CTX (test 6)\n");
306 printf("Error finalising data (test 6)\n");
311 if (strcmp(p, (char *)test[7].digest) != 0) {
312 printf("Error calculating HMAC on test 6\n");
313 printf("got %s instead of %s\n", p, test[7].digest);
316 printf("test 6 ok\n");