asn1_encoder.c (c441bfb5f2866de71e092c1b9d866a65978dfe1a) | asn1_encoder.c (9dbbc3b9d09d6deba9f3b9e1d5b355032ed46a75) |
---|---|
1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Simple encoder primitives for ASN.1 BER/DER/CER 4 * 5 * Copyright (C) 2019 James.Bottomley@HansenPartnership.com 6 */ 7 8#include <linux/asn1_encoder.h> --- 167 unchanged lines hidden (view full) --- 176 177 return d; 178} 179EXPORT_SYMBOL_GPL(asn1_encode_oid); 180 181/** 182 * asn1_encode_length() - encode a length to follow an ASN.1 tag 183 * @data: pointer to encode at | 1// SPDX-License-Identifier: GPL-2.0-only 2/* 3 * Simple encoder primitives for ASN.1 BER/DER/CER 4 * 5 * Copyright (C) 2019 James.Bottomley@HansenPartnership.com 6 */ 7 8#include <linux/asn1_encoder.h> --- 167 unchanged lines hidden (view full) --- 176 177 return d; 178} 179EXPORT_SYMBOL_GPL(asn1_encode_oid); 180 181/** 182 * asn1_encode_length() - encode a length to follow an ASN.1 tag 183 * @data: pointer to encode at |
184 * @data_len: pointer to remaning length (adjusted by routine) | 184 * @data_len: pointer to remaining length (adjusted by routine) |
185 * @len: length to encode 186 * 187 * This routine can encode lengths up to 65535 using the ASN.1 rules. 188 * It will accept a negative length and place a zero length tag 189 * instead (to keep the ASN.1 valid). This convention allows other 190 * encoder primitives to accept negative lengths as singalling the 191 * sequence will be re-encoded when the length is known. 192 */ --- 262 unchanged lines hidden --- | 185 * @len: length to encode 186 * 187 * This routine can encode lengths up to 65535 using the ASN.1 rules. 188 * It will accept a negative length and place a zero length tag 189 * instead (to keep the ASN.1 valid). This convention allows other 190 * encoder primitives to accept negative lengths as singalling the 191 * sequence will be re-encoded when the length is known. 192 */ --- 262 unchanged lines hidden --- |