Wrap DH public key in a ASN.1 INTEGER wrapping.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16096 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -606,20 +606,11 @@ build_auth_pack(krb5_context context,
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
dhbuf.length = length_heim_integer(&dh_pub_key);
|
ASN1_MALLOC_ENCODE(DHPublicKey, dhbuf.data, dhbuf.length,
|
||||||
dhbuf.data = malloc(dhbuf.length);
|
&dh_pub_key, &size, ret);
|
||||||
if (dhbuf.data == NULL) {
|
|
||||||
free_heim_integer(&dh_pub_key);
|
|
||||||
krb5_set_error_string(context, "malloc: out of memory");
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
ret = der_put_heim_integer((char *)dhbuf.data + dhbuf.length - 1,
|
|
||||||
dhbuf.length, &dh_pub_key, &size);
|
|
||||||
free_heim_integer(&dh_pub_key);
|
free_heim_integer(&dh_pub_key);
|
||||||
if (ret) {
|
if (ret)
|
||||||
free(dhbuf.data);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
|
||||||
if (size != dhbuf.length)
|
if (size != dhbuf.length)
|
||||||
krb5_abortx(context, "asn1 internal error");
|
krb5_abortx(context, "asn1 internal error");
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user