Changeset 1414:f6f12521c2aa in freeDiameter
- Timestamp:
- Feb 18, 2020, 5:01:49 PM (4 years ago)
- Branch:
- default
- Phase:
- public
- committer:
- Luke Mewburn <luke@mewburn.net> 1582020002 -39600
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/app_radgw/md5.c
r1291 r1414 287 287 288 288 /* Append length in bits and transform */ 289 ((u32 *) ctx->in)[14] = ctx->bits[0]; 290 ((u32 *) ctx->in)[15] = ctx->bits[1]; 289 os_memcpy(&ctx->in[56], &ctx->bits[0], 8); 291 290 292 291 MD5Transform(ctx->buf, (u32 *) ctx->in); -
extensions/app_sip/md5.c
r1291 r1414 310 310 311 311 /* Append length in bits and transform */ 312 ((u32 *) ctx->in)[14] = ctx->bits[0]; 313 ((u32 *) ctx->in)[15] = ctx->bits[1]; 312 os_memcpy(&ctx->in[56], &ctx->bits[0], 8); 314 313 315 314 MD5Transform(ctx->buf, (u32 *) ctx->in); -
include/freeDiameter/libfdproto.h
r1407 r1414 690 690 /* create a V4MAPPED address */ 691 691 #define IN6_ADDR_V4MAP( a6, a4 ) { \ 692 ((uint32_t *)(a6))[0] = 0; \693 ( (uint32_t *)(a6))[1] = 0;\694 ( (uint32_t *)(a6))[2] = htonl(0xffff);\695 ((uint32_t *)(a6))[3] = (uint32_t)(a4);\692 memset(&(*a6)[0], 0, 10); \ 693 (*a6)[10] = 0xff; \ 694 (*a6)[11] = 0xff; \ 695 memcpy(&(*a6)[12], &a4, 4); \ 696 696 } 697 697 -
tests/testmesg.c
r1300 r1414 1449 1449 } 1450 1450 } 1451 1452 /* Check IPv4 -> IPv6 and IPv6->IPv4 mapping */ 1453 { 1454 struct in_addr i4; 1455 memset(&i4, 0xff, sizeof(i4)); 1456 CHECK( 1, inet_pton( AF_INET, TEST_IP4, &i4 ) ); 1457 1458 #define TEST_IP6MAP "::ffff:" TEST_IP4 1459 1460 struct in6_addr i6; 1461 memset(&i6, 0xff, sizeof(i6)); 1462 IN6_ADDR_V4MAP(&i6.s6_addr, i4.s_addr); 1463 char buf6[INET6_ADDRSTRLEN]; 1464 CHECK( 0, (inet_ntop( AF_INET6, &i6, buf6, sizeof(buf6) ) == NULL) ? errno : 0 ); 1465 LOG_D("buf6='%s'", buf6); 1466 CHECK( 0, strcasecmp( buf6, TEST_IP6MAP ) ); 1467 1468 struct in_addr o4; 1469 o4.s_addr = IN6_ADDR_V4UNMAP(&i6); 1470 char buf4[INET_ADDRSTRLEN]; 1471 CHECK( 0, (inet_ntop( AF_INET, &o4.s_addr, buf4, sizeof(buf4) ) == NULL) ? errno : 0 ); 1472 CHECK( 0, strcmp( buf4, TEST_IP4 ) ); 1473 } 1451 1474 1452 1475 /* That's all for the tests yet */
Note: See TracChangeset
for help on using the changeset viewer.