Skip to content

Commit 97ed821

Browse files
authored
Merge pull request #158 from avsm/base64-3
support base64.3.0.0
2 parents 2a5def0 + 385c1ad commit 97ed821

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
v1.1.1
2+
------
3+
4+
* Support Base64.3.0.0 interface (@avsm)
5+
16
v1.1.0 2019-01-05
27
-----------------
38

dns.opam

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ depends: [
3737
"re" {>="1.7.2"}
3838
"ipaddr" {>= "2.6.0"}
3939
"uri" {>= "1.7.0"}
40-
"base64" {>= "2.0.0"}
40+
"base64" {>= "3.0.0"}
4141
"hashcons"
4242
"result"
4343
]

lib/loader.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ let add_srv_rr pri weight port target ttl owner db =
274274
let add_dnskey_rr flags typ key ttl owner db =
275275
let flags = flags in
276276
let typ = typ in
277-
let tmp = B64.decode key in
277+
let tmp = Base64.decode_exn key in
278278
let dnskey = Name.hashcons_string tmp in
279279
add_rrset { ttl; rdata = DNSKEY [ (flags, typ, dnskey) ] } owner db
280280

@@ -344,7 +344,7 @@ let add_rrsig_rr typ alg lbl orig_ttl exp_ts inc_ts tag name sign ttl owner db =
344344
| Some a -> a
345345
in
346346
(* TODO: Check if sign is in the future or if the sign has expired *)
347-
let sign = B64.decode sign in
347+
let sign = Base64.decode_exn sign in
348348
let rr = RRSIG [{
349349
rrsig_type = typ;
350350
rrsig_alg = alg;

lib/packet.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ let rdata_to_string = function
260260
| DNSKEY (flags, alg, key)
261261
-> (sprintf "DNSKEY (%d, %s, %s)"
262262
flags (dnssec_alg_to_string alg)
263-
(B64.encode key)
263+
(Base64.encode_exn key)
264264
)
265265
| HINFO (cpu, os) -> sprintf "HINFO (%s, %s)" cpu os
266266
| ISDN (a, sa)
@@ -292,7 +292,7 @@ let rdata_to_string = function
292292
| SRV (x, y, z, n)
293293
-> sprintf "SRV (%d,%d,%d, %s)" x y z (Name.to_string n)
294294
| TXT sl -> sprintf "TXT (%s)" (String.concat "" sl)
295-
| UNKNOWN (x, bs) -> sprintf "UNKNOWN (%d) '%s'" x (B64.encode bs)
295+
| UNKNOWN (x, bs) -> sprintf "UNKNOWN (%d) '%s'" x (Base64.encode_exn bs)
296296
(* | UNSPEC bs -> sprintf "UNSPEC (%s)" bs*)
297297
| WKS (a, y, s) ->
298298
sprintf "WKS (%s, %d, %s)" (Ipaddr.V4.to_string a) (Cstruct.byte_to_int y) s
@@ -304,11 +304,11 @@ let rdata_to_string = function
304304
sprintf "RRSIG (%s %s %d %ld %ld %ld %d %s %s)"
305305
(rr_type_to_string typ)
306306
(dnssec_alg_to_string alg) (int_of_char lbl) orig_ttl exp_ts inc_ts
307-
tag (Name.to_string name) (B64.encode sign)
307+
tag (Name.to_string name) (Base64.encode_exn sign)
308308
| SIG (alg, exp_ts, inc_ts, tag, name, sign) ->
309309
sprintf "SIG (UNUSED %s 0 0 %ld %ld %d %s %s)"
310310
(dnssec_alg_to_string alg) exp_ts inc_ts
311-
tag (Name.to_string name) (B64.encode sign)
311+
tag (Name.to_string name) (Base64.encode_exn sign)
312312
| DS (keytag, alg, digest_t, digest)
313313
-> (sprintf "DS (%d,%s,%s, '%s')" keytag
314314
(dnssec_alg_to_string alg) (digest_alg_to_string digest_t)

0 commit comments

Comments
 (0)