return TRUE;
}
+/*
+ * Described in header
+ */
+u_int64_t asn1_parse_integer_uint64(chunk_t blob)
+{
+ u_int64_t val = 0;
+ int i;
+
+ for (i = 0; i < blob.len; i++)
+ { /* if it is longer than 8 bytes, we just use the 8 LSBs */
+ val <<= 8;
+ val |= (u_int64_t)blob.ptr[i];
+ }
+ return val;
+}
+
/**
* ASN.1 definition of an algorithmIdentifier
*/
const char* name);
/**
+ * Converts an ASN.1 INTEGER object to an u_int64_t. If the INTEGER is longer
+ * than 8 bytes only the 8 LSBs are returned.
+ *
+ * @param blob body of an ASN.1 coded integer object
+ * @return converted integer
+ */
+u_int64_t asn1_parse_integer_uint64(chunk_t blob);
+
+/**
* Print the value of an ASN.1 simple object
*
* @param object ASN.1 object to be printed
}
/**
- * Converts an ASN.1 INTEGER object to an u_int64_t. If the INTEGER is longer
- * than 8 bytes only the 8 LSBs are returned.
- *
- * @param blob body of an ASN.1 coded integer object
- * @return converted integer
- */
-static u_int64_t parse_asn1_integer_uint64(chunk_t blob)
-{
- u_int64_t val = 0;
- int i;
-
- for (i = 0; i < blob.len; i++)
- { /* if it is longer than 8 bytes, we just use the 8 LSBs */
- val <<= 8;
- val |= (u_int64_t)blob.ptr[i];
- }
- return val;
-}
-
-/**
* ASN.1 definition of a PBEParameter structure
*/
static const asn1Object_t pbeParameterObjects[] = {
}
case PBEPARAM_ITERATION_COUNT:
{
- this->iterations = parse_asn1_integer_uint64(object);
+ this->iterations = asn1_parse_integer_uint64(object);
break;
}
}
}
case PBKDF2_ITERATION_COUNT:
{
- this->iterations = parse_asn1_integer_uint64(object);
+ this->iterations = asn1_parse_integer_uint64(object);
break;
}
case PBKDF2_KEYLENGTH:
{
- this->keylen = (size_t)parse_asn1_integer_uint64(object);
+ this->keylen = (size_t)asn1_parse_integer_uint64(object);
break;
}
case PBKDF2_PRF: