- pos = strlen (GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX);
- if ( (slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) ||
- (0 != strncmp (s, GNUNET_FS_URI_PREFIX GNUNET_FS_URI_LOC_INFIX,
- pos) ) )
- return NULL; /* not an SKS URI */
- if ( (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') ||
- (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2 - 1] != '.') )
- {
- *emsg = GNUNET_strdup (_("SKS URI malformed"));
- return NULL;
- }
- memcpy (h1,
- &s[pos],
- sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded));
- h1[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)-1] = '\0';
- memcpy (h2,
- &s[pos + sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)],
- sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded));
- h2[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)-1] = '\0';
-
- if ((GNUNET_OK != GNUNET_CRYPTO_hash_from_string (h1,
- &ass.fi.chk.key)) ||
- (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (h2,
- &ass.fi.chk.query)) ||
- (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2],
- "%llu",
- &flen)) )
- {
- *emsg = GNUNET_strdup (_("SKS URI malformed"));
- return NULL;
- }
+ pos = strlen (GNUNET_FS_URI_LOC_PREFIX);
+ if ((slen < pos + 2 * sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) + 1) ||
+ (0 != strncmp (s, GNUNET_FS_URI_LOC_PREFIX, pos)))
+ return NULL; /* not an SKS URI */
+ if ((s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] != '.') ||
+ (s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2 - 1] != '.'))
+ {
+ *emsg = GNUNET_strdup (_("SKS URI malformed"));
+ return NULL;
+ }
+ memcpy (h1, &s[pos], sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
+ h1[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] = '\0';
+ memcpy (h2, &s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded)],
+ sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded));
+ h2[sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) - 1] = '\0';
+
+ if ((GNUNET_OK != GNUNET_CRYPTO_hash_from_string (h1, &ass.fi.chk.key)) ||
+ (GNUNET_OK != GNUNET_CRYPTO_hash_from_string (h2, &ass.fi.chk.query)) ||
+ (1 !=
+ SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2],
+ "%llu", &flen)))
+ {
+ *emsg = GNUNET_strdup (_("SKS URI malformed"));
+ return NULL;
+ }