Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merging with latest pianobar.

  • Loading branch information...
commit 6907b73e04167b019467120d30bdb3fd0a8c2f6f 1 parent babede1
Joshua V. Dillon authored
Showing with 1,107 additions and 4,215 deletions.
  1. +47 −24 INSTALL
  2. +2 −1  LICENSE
  3. +101 −47 Makefile
  4. +7 −0 README
  5. +13 −2 contrib/config-example
  6. +77 −23 contrib/pianobarfly.1
  7. +1 −1  src/config.h
  8. +17 −19 src/fly.c
  9. +0 −2  src/fly.h
  10. +5 −0 src/fly_mp4.c
  11. +0 −20 src/libezxml/COPYING
  12. +0 −718 src/libezxml/ezxml.c
  13. +0 −93 src/libezxml/ezxml.h
  14. +48 −148 src/libpiano/crypt.c
  15. +6 −3 src/libpiano/crypt.h
  16. +0 −219 src/libpiano/crypt_key_input.h
  17. +0 −217 src/libpiano/crypt_key_output.h
  18. +74 −1,001 src/libpiano/piano.c
  19. +83 −42 src/libpiano/piano.h
  20. +5 −4 src/libpiano/piano_private.h
  21. +0 −979 src/libpiano/xml.c
  22. +0 −49 src/libpiano/xml.h
  23. +68 −55 src/libwaitress/waitress.c
  24. +15 −8 src/libwaitress/waitress.h
  25. +46 −84 src/main.c
  26. +31 −31 src/player.c
  27. +19 −19 src/player.h
  28. +173 −157 src/settings.c
  29. +23 −18 src/settings.h
  30. +2 −0  src/terminal.c
  31. +77 −85 src/ui.c
  32. +4 −2 src/ui.h
  33. +106 −69 src/ui_act.c
  34. +1 −1  src/ui_act.h
  35. +37 −34 src/ui_dispatch.h
  36. +18 −38 src/ui_readline.c
  37. +1 −2  src/ui_types.h
View
71 INSTALL
@@ -4,13 +4,16 @@ Install
Dependencies
------------
-gmake
-libao http://www.xiph.org/ao/
-libfaad2 http://www.audiocoding.com/downloads.html
-AND/OR libmad http://www.underbit.com/products/mad/
-pthreads
-libid3tag http://www.underbit.com/products/mad/
-UTF-8 console/locale!
+- gmake
+- pthreads
+- libao
+- gnutls
+- gcrypt
+- json-c
+- libfaad2 (compiled with --without-drm)
+- libmad (optional, Pandora One users only)
+- UTF-8 console/locale
+- libid3tag http://www.underbit.com/products/mad/
Building
--------
@@ -19,13 +22,6 @@ If you have all of the dependencies listed above just type
make clean && make
-NOTE: The above won't work on Mac OS X (Snow Leopard) since c99 targets i386
-and cc (gcc4.2) targets x86_64. If you've built supporting libraries
-(libao, etc.) using gcc, you'll be unable to link. You can work around
-this issue by overriding CFLAGS[1]
-
- make clean && make CFLAGS="-O2 -DNDEBUG -W64"
-
You can run the client directly from the source directory now
./pianobarfly
@@ -34,23 +30,50 @@ Or install it by issuing
make install
-In case you don't want to install libmad OR libfaad you probably want to
-disable one of them:
+Selecting features
+++++++++++++++++++
- make clean && make DISABLE_FAAD=1
+It is possible to disable certain features when building pianobar by setting
+one of the variables listed below. In fact it is required if you don’t have the
+corresponding library installed. So if you don’t want AAC playback or don’t
+have libfaad installed for example, run
-or
+ gmake DISABLE_FAAD=1
- make clean && make DISABLE_MAD=1
+instead of a plain `gmake`.
-You can also disable libid3tag:
+DISABLE_FAAD=1
+ Disables AAC playback.
+DISABLE_MAD=1
+ Disables MP3 playback.
+DISABLE_ID3TAG=1
+ Disables libid3tag.
- make clean && make DISABLE_ID3TAG=1
+Mac OS X
+++++++++
-libpiano can be built and installed by running
-
- make clean && make libpiano && make install-libpiano
+NOTE: The above won't work on Mac OS X (Snow Leopard) since c99 targets i386
+and cc (gcc4.2) targets x86_64. If you've built supporting libraries
+(libao, etc.) using gcc, you'll be unable to link. You can work around
+this issue by overriding CFLAGS[1]
+ make clean && make CFLAGS="-O2 -DNDEBUG -W64"
[1] https://github.com/PromyLOPh/pianobar/issues/98
+Ubuntu 12.04
+++++++++++++
+
+To install on Ubuntu >= 12.04
+
+ sudo apt-get install \
+ libao-dev \
+ libmad0-dev \
+ libfaad-dev \
+ libgnutls-dev \
+ libjson0-dev \
+ libgcrypt11-dev
+ make
+ sudo make install
+
+You can then fire it up with `pianobarfly`
View
3  LICENSE
@@ -1,7 +1,8 @@
-Copyright (c) 2008-2011
+Copyright (c) 2008-2012
Lars-Dominik Braun <lars@6xq.net>
Ted Jordan <silverfunk@gmail.com>
Geoffrey Huntley <ghuntley@ghuntley.com>
+ Joshua V. Dillon <jvdillon@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
View
148 Makefile
@@ -48,14 +48,12 @@ LIBPIANO_DIR=src/libpiano
LIBPIANO_SRC=\
${LIBPIANO_DIR}/crypt.c \
${LIBPIANO_DIR}/piano.c \
- ${LIBPIANO_DIR}/xml.c
+ ${LIBPIANO_DIR}/request.c \
+ ${LIBPIANO_DIR}/response.c
LIBPIANO_HDR=\
${LIBPIANO_DIR}/config.h \
- ${LIBPIANO_DIR}/crypt_key_output.h \
- ${LIBPIANO_DIR}/xml.h \
${LIBPIANO_DIR}/crypt.h \
${LIBPIANO_DIR}/piano.h \
- ${LIBPIANO_DIR}/crypt_key_input.h \
${LIBPIANO_DIR}/piano_private.h
LIBPIANO_OBJ=${LIBPIANO_SRC:.c=.o}
LIBPIANO_RELOBJ=${LIBPIANO_SRC:.c=.lo}
@@ -70,81 +68,137 @@ LIBWAITRESS_OBJ=${LIBWAITRESS_SRC:.c=.o}
LIBWAITRESS_RELOBJ=${LIBWAITRESS_SRC:.c=.lo}
LIBWAITRESS_INCLUDE=${LIBWAITRESS_DIR}
-LIBEZXML_DIR=src/libezxml
-LIBEZXML_SRC=${LIBEZXML_DIR}/ezxml.c
-LIBEZXML_HDR=${LIBEZXML_DIR}/ezxml.h
-LIBEZXML_OBJ=${LIBEZXML_SRC:.c=.o}
-LIBEZXML_RELOBJ=${LIBEZXML_SRC:.c=.lo}
-LIBEZXML_INCLUDE=${LIBEZXML_DIR}
-
-ifneq (${DISABLE_FAAD}, 1)
+ifeq (${DISABLE_FAAD}, 1)
+ LIBFAAD_CFLAGS=
+ LIBFAAD_LDFLAGS=
+else
LIBFAAD_CFLAGS=-DENABLE_FAAD
LIBFAAD_LDFLAGS=-lfaad
endif
-ifneq (${DISABLE_MAD}, 1)
- LIBMAD_CFLAGS=${shell pkg-config --cflags mad} -DENABLE_MAD
- LIBMAD_LDFLAGS=${shell pkg-config --libs mad}
+ifeq (${DISABLE_MAD}, 1)
+ LIBMAD_CFLAGS=
+ LIBMAD_LDFLAGS=
+else
+ LIBMAD_CFLAGS=-DENABLE_MAD
+ LIBMAD_CFLAGS+=$(shell pkg-config --cflags mad)
+ LIBMAD_LDFLAGS=$(shell pkg-config --libs mad)
endif
-LIBGNUTLS_CFLAGS=
-LIBGNUTLS_LDFLAGS=-lgnutls
+LIBGNUTLS_CFLAGS=$(shell pkg-config --cflags gnutls)
+LIBGNUTLS_LDFLAGS=$(shell pkg-config --libs gnutls)
-ifneq (${DISABLE_ID3TAG}, 1)
- LIBID3TAG_CFLAGS=${shell pkg-config --cflags id3tag} -DENABLE_ID3TAG
- LIBID3TAG_LDFLAGS=${shell pkg-config --libs id3tag}
-endif
+LIBGCRYPT_CFLAGS=
+LIBGCRYPT_LDFLAGS=-lgcrypt
-LIBAO_CFLAGS=${shell pkg-config --cflags ao}
-LIBAO_LDFLAGS=${shell pkg-config --libs ao}
+LIBJSONC_CFLAGS=$(shell pkg-config --cflags json)
+LIBJSONC_LDFLAGS=$(shell pkg-config --libs json)
+
+ifeq (${DISABLE_ID3TAG}, 1)
+ LIBID3TAG_CFLAGS=
+ LIBID3TAG_LDFLAGS=
+else
+ LIBID3TAG_CFLAGS=$(shell pkg-config --cflags id3tag) -DENABLE_ID3TAG
+ LIBID3TAG_LDFLAGS=$(shell pkg-config --libs id3tag)
+endif
# build pianobarfly
ifeq (${DYNLINK},1)
pianobarfly: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.0
- ${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} ${LIBAO_LDFLAGS} -lpthread -L. \
- -lpiano ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
+ @echo " LINK $@"
+ @${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
+ ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
else
pianobarfly: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \
- ${LIBWAITRESS_HDR} ${LIBEZXML_OBJ} ${LIBEZXML_HDR}
- ${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
- ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ} ${LIBAO_LDFLAGS} -lpthread \
- ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} ${LIBID3TAG_LDFLAGS} -o $@
+ ${LIBWAITRESS_HDR}
+ @echo " LINK $@"
+ @${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
+ ${LIBWAITRESS_OBJ} -lao -lpthread -lm \
+ ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} \
+ ${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} ${LIBID3TAG_LDFLAGS} -o $@
endif
# build shared and static libpiano
libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
- ${LIBWAITRESS_HDR} ${LIBEZXML_RELOBJ} ${LIBEZXML_HDR} \
- ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
- ${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} \
+ ${LIBWAITRESS_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
+ @echo " LINK $@"
+ @${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} \
-o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \
- ${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ}
- ln -s libpiano.so.0.0.0 libpiano.so.0
- ln -s libpiano.so.0 libpiano.so
- ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
-
+ ${LIBWAITRESS_RELOBJ} ${LIBGNUTLS_LDFLAGS} ${LIBGCRYPT_LDFLAGS} \
+ ${LIBJSONC_LDFLAGS}
+ @ln -s libpiano.so.0.0.0 libpiano.so.0
+ @ln -s libpiano.so.0 libpiano.so
+ @echo " AR libpiano.a"
+ @${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
+
+
+# build dependency files
+%.d: %.c
+ @set -e; rm -f $@; \
+ $(CC) -M ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBFAAD_CFLAGS} ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} \
+ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} $< > $@.$$$$; \
+ sed '1 s,^.*\.o[ :]*,$*.o $@ : ,g' < $@.$$$$ > $@; \
+ rm -f $@.$$$$
+
+-include $(PIANOBAR_SRC:.c=.d)
+-include $(LIBPIANO_SRC:.c=.d)
+-include $(LIBWAITRESS_SRC:.c=.d)
+
+# build standard object files
%.o: %.c
- ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
- -I ${LIBEZXML_INCLUDE} ${LIBFAAD_CFLAGS} \
- ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} ${LIBID3TAG_CFLAGS} ${LIBAO_CFLAGS} -c -o $@ $<
+ @echo " CC $<"
+ @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBFAAD_CFLAGS} ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} \
+ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} ${LIBID3TAG_CFLAGS} -c -o $@ $<
# create position independent code (for shared libraries)
%.lo: %.c
- ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
- -I ${LIBEZXML_INCLUDE} -c -fPIC -o $@ $<
+ @echo " CC $< (PIC)"
+ @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
+ ${LIBJSONC_CFLAGS} \
+ -c -fPIC -o $@ $<
clean:
- ${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
- ${LIBEZXML_OBJ} ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} \
- ${LIBEZXML_RELOBJ} pianobarfly libpiano.so* libpiano.a waitress-test
+ @echo " CLEAN"
+ @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
+ ${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} pianobarfly libpiano.so* \
+ libpiano.a waitress-test $(PIANOBAR_SRC:.c=.d) $(LIBPIANO_SRC:.c=.d) \
+ $(LIBWAITRESS_SRC:.c=.d)
all: pianobarfly
debug: pianobarfly
-debug: CFLAGS=-Wall -pedantic -ggdb -DDEBUG
+debug: CFLAGS=-pedantic -ggdb -Wall -Wmissing-declarations -Wshadow -Wcast-qual \
+ -Wformat=2 -Winit-self -Wignored-qualifiers -Wmissing-include-dirs \
+ -Wfloat-equal -Wundef -Wpointer-arith -Wtype-limits -Wbad-function-cast \
+ -Wcast-align -Wclobbered -Wempty-body -Wjump-misses-init -Waddress \
+ -Wlogical-op -Waggregate-return -Wstrict-prototypes \
+ -Wold-style-declaration -Wold-style-definition -Wmissing-parameter-type \
+ -Wmissing-prototypes -Wmissing-field-initializers -Woverride-init \
+ -Wpacked -Wredundant-decls -Wnested-externs
+# warnings for gcc 4.5; disabled:
+# -Wswitch-default: too many bogus warnings
+# -Wswitch-enum: too many bogus warnings
+# -Wunused-parameter: too many bogus warnings
+# -Wstrict-overflow: depends on optimization level
+# -Wunsafe-loop-optimizations: depends on optimization level
+# -Wwrite-strings: to be enabled
+# -Wconversion: too many (bogus?) warnings
+# -Wsign-conversion: same here
+# -Wsign-compare: to be enabled
+# -Wmissing-noreturn: recommendation
+# -Wmissing-format-attribute: same here
+# -Wpadded: have a closer look at this one
+# -Winline: we don't care
+# -Winvalid-pch: not our business
+# -Wdisabled-optimization: depends on optimization level
+# -Wstack-protector: we don't use stack protector
+# -Woverlength-strings: over-portability-ish
waitress-test: CFLAGS+= -DTEST
waitress-test: ${LIBWAITRESS_OBJ}
- ${CC} ${LDFLAGS} ${LIBWAITRESS_OBJ} -o waitress-test
+ ${CC} ${LDFLAGS} ${LIBWAITRESS_OBJ} ${LIBGNUTLS_LDFLAGS} -o waitress-test
test: waitress-test
./waitress-test
View
7 README
@@ -11,3 +11,10 @@ pianobarfly is a console client for the personalized web radio pandora
- last.fm scrobbling support (external application)
- proxy support for listeners outside the USA
- auto-rips streams to audio files
+
+The sourcecode for pianobar can be downloaded at:
+ http://github.com/PromyLOPh/pianobar/
+or,
+ http://6xq.net/projects/pianobar/
+The sourcecode for pianobarfly can be downloaded at:
+ http://github.com/ghuntley/pianobarfly
View
15 contrib/config-example
@@ -48,8 +48,7 @@
#embed_cover = true
# Misc
-# mp3, mp3-hifi or aacplus
-#audio_format = aacplus
+#audio_quality = low
#autostart_station = 123456
#event_command = /home/user/.config/pianobarfly/eventcmd
#fifo = /tmp/pianobar
@@ -62,3 +61,15 @@
# Format strings
#format_nowplaying_song = %t by %a on %l%r%@%s
#format_nowplaying_station = Station %n
+#format_list_song = %i) %a - %t%r
+
+# high-quality audio (192k mp3, for Pandora One subscribers only!)
+#audio_quality = high
+#rpc_host = internal-tuner.pandora.com
+#partner_user = pandora one
+#partner_password = TVCKIBGS9AO9TSYLNNFUML0743LH82D
+#device = D01
+#encrypt_password = 2%3WCL*JU$MP]4
+#decrypt_password = U#IO$RZPAB%VX2
+#tls_fingerprint = 394067EECB420E3911985C2CC02C12AE89BB09B2
+
View
100 contrib/pianobarfly.1
@@ -1,3 +1,9 @@
+.\" Continuation line for .TP header.
+.de TQ
+. br
+. ns
+. TP \\$1\" no doublequotes around argument!
+..
.TH pianobarfly 1
.SH NAME
@@ -32,8 +38,9 @@ http://xiph.org/ao/doc/config.html
.SH CONFIGURATION
The configuration file consists of simple
.B key = value
-lines. Each terminated with a newline (\\n) character. Keys and values are both
-case sensitive.
+lines, each terminated with a newline (\\n) character. Note that keys and
+values are both case sensitive, and there must be exactly one space on each
+side of the equals sign.
act_* keys control
.B pianobarfly's
@@ -108,6 +115,7 @@ Skip current song.
.TP
.B act_songpause = p
+.B act_songpause2 = <Space>
Pause/Continue
.TP
@@ -133,6 +141,10 @@ Ban song for one month.
Show next songs in playlist.
.TP
+.B act_stationcreatefromsong = v
+Create new station from the current song or artist.
+
+.TP
.B act_stationselectquickmix = x
Select quickmix stations. You can toggle the selection with 't', select all
with 'a' or select none with 'n'.
@@ -150,9 +162,13 @@ Increase volume.
Replacement for %@ in station format string. It's " @ " by default.
.TP
-.B audio_format = {aacplus,mp3,mp3-hifi}
-Select audio format. aacplus is default if both libraries (faad, mad) are
-available. mp3-hifi is available for Pandora One customers only.
+.B audio_quality = {high, medium, low}
+Select audio quality.
+
+.TP
+.B autoselect = {1,0}
+Auto-select last remaining item of filtered list. Currently enabled for station
+selection only.
.TP
.B audio_file_dir = ./mp3
@@ -203,6 +219,15 @@ will use this proxy. The music is streamed directly.
If true the cover art will be embedded in the audio file's meta data.
.TP
+.B decrypt_password = R=U!LH$O2B#
+
+.TP
+.B device = android-generic
+
+.TP
+.B encrypt_password = 6#26FRL$ZWD
+
+.TP
.B event_command = path
File that is executed when event occurs. See section
.B EVENTCMD
@@ -214,6 +239,40 @@ usually the value above). See section
.B REMOTE CONTROL
.TP
+.B format_list_song = %i) %a - %t%r
+Available format characters:
+
+.B %i
+Song number
+
+.B %a
+Song artist
+
+.B %t
+Song title
+
+.B %r
+Rating icon
+
+.TP
+.B format_msg_none = %s
+.TQ
+.B format_msg_info = (i) %s
+.TQ
+.B format_msg_nowplaying = |> %s
+.TQ
+.B format_msg_time = # %s
+.TQ
+.B format_msg_err = /!\\\\ %s
+.TQ
+.B format_msg_question = [?] %s
+.TQ
+.B format_msg_list = \\t%s
+Message format strings.
+.B %s
+is replaced with the actual message.
+
+.TP
.B format_nowplaying_song = \[dq]%t\[dq] by \[dq]%a\[dq] on \[dq]%l\[dq]%r%@%s
Now playing song message format. Available format characters are:
@@ -250,24 +309,6 @@ Station name
Station id
.TP
-.B format_msg_none = %s
-.TQ
-.B format_msg_info = (i) %s
-.TQ
-.B format_msg_nowplaying = |> %s
-.TQ
-.B format_msg_time = # %s
-.TQ
-.B format_msg_err = /!\\\\ %s
-.TQ
-.B format_msg_question = [?] %s
-.TQ
-.B format_msg_list = \\t%s
-Message format strings.
-.B %s
-is replaced with the actual message.
-
-.TP
.B history = 5
Keep a history of the last n songs (5, by default). You can rate these songs.
@@ -276,6 +317,12 @@ Keep a history of the last n songs (5, by default). You can rate these songs.
Icon for loved songs.
.TP
+.B partner_password = AC7IBG09A3DTSYM4R41UJWL07VLN8JI7
+
+.TP
+.B partner_user = android
+
+.TP
.B password = plaintext_password
Your pandora.com password. Plain-text.
@@ -285,12 +332,19 @@ Use a http proxy. Note that this setting overrides the http_proxy environment
variable.
.TP
+.B rpc_host = tuner.pandora.com
+
+.TP
.B sort = {name_az, name_za, quickmix_01_name_az, quickmix_01_name_za, quickmix_10_name_az, quickmix_10_name_za}
Sort station list by name or type (is quickmix) and name. name_az for example
sorts by name from a to z, quickmix_01_name_za by type (quickmix at the
bottom) and name from z to a.
.TP
+.B tls_fingerprint = D9980BA2CC0F97BB03822C6211EAEA4A06EEF427
+Hex-encoded SHA1 fingerprint of Pandora's TLS certificate.
+
+.TP
.B user = your@user.name
Your pandora.com username.
View
2  src/config.h
@@ -4,6 +4,6 @@
/* package name */
#define PACKAGE "pianobarfly"
-#define VERSION "2011.11.12"
+#define VERSION "2012.06.24-dev"
#endif /* _CONFIG_H */
View
36 src/fly.c
@@ -269,14 +269,14 @@ static int _BarFlyFetchURL(char const* url, uint8_t** buffer, size_t* size,
*/
status = WaitressSetUrl(&fly_waith, url);
if (status != 1) {
- BarUiMsg(settings, MSG_DEBUG, "Invalid URL (%s).\n", url);
+ BarUiMsg(settings, MSG_INFO, "Invalid URL (%s).\n", url);
goto error;
}
status_waith = WaitressFetchBufEx(&fly_waith, (char**)&tmp_buffer,
&tmp_size);
if ((status_waith != WAITRESS_RET_OK) || (tmp_buffer == NULL)) {
- BarUiMsg(settings, MSG_DEBUG, "Failed to fetch the URL contents "
+ BarUiMsg(settings, MSG_INFO, "Failed to fetch the URL contents "
"(url = %s, waitress status = %d).\n", url, status_waith);
goto error;
}
@@ -316,7 +316,7 @@ static int _BarFlyFileDelete(BarFly_t const* fly,
/*
* Delete the file.
*/
- BarUiMsg(settings, MSG_DEBUG, "Deleting partially recorded file (%s).\n",
+ BarUiMsg(settings, MSG_INFO, "Deleting partially recorded file (%s).\n",
fly->audio_file_path);
status = unlink(fly->audio_file_path);
if (status != 0) {
@@ -406,7 +406,6 @@ static char* _BarFlyFileGetPath(char const* artist, char const* album,
#ifdef ENABLE_MAD
case PIANO_AF_MP3:
- case PIANO_AF_MP3_HI:
extension = ".mp3";
break;
#endif
@@ -576,7 +575,7 @@ static int _BarFlyFileOpen(FILE** file, char const* path,
*/
tmp_file = _BarFlyFileOpenStream(path, "wb");
if ((tmp_file == NULL) && (errno == EEXIST)) {
- BarUiMsg(settings, MSG_DEBUG, "The audio file already exists. It will "
+ BarUiMsg(settings, MSG_INFO, "The audio file already exists. It will "
"not be recorded (%s).\n", path);
exit_status = -2;
goto error;
@@ -724,7 +723,7 @@ static char* _BarFlyParseCoverArtURL(char const* html,
status = regexec(&regex_cover, html, MATCH_COUNT, cover_match, 0);
if (status != 0) {
regerror(status, &regex_cover, error_msg, ERROR_MSG_SIZE);
- BarUiMsg(settings, MSG_DEBUG, "The cover art was not included in the "
+ BarUiMsg(settings, MSG_INFO, "The cover art was not included in the "
"album detail page (%d:%s).\n", status, error_msg);
goto error;
}
@@ -746,7 +745,7 @@ static char* _BarFlyParseCoverArtURL(char const* html,
* albums list could also use this image.
*/
if (strstr(url, "no_album_art.jpg") != NULL) {
- BarUiMsg(settings, MSG_DEBUG, "This album does not have cover art.\n");
+ BarUiMsg(settings, MSG_INFO, "This album does not have cover art.\n");
goto error;
}
@@ -857,7 +856,7 @@ static int _BarFlyParseTrackDisc(char const* title, char const* album_xml,
status = regexec(&regex_track, album_xml, MATCH_COUNT, match, 0);
if (status != 0) {
regerror(status, &regex_track, error_msg, ERROR_MSG_SIZE);
- BarUiMsg(settings, MSG_DEBUG, "The track and disc numbers were not "
+ BarUiMsg(settings, MSG_INFO, "The track and disc numbers were not "
"included in the album explorer page (%d:%s).\n", status,
error_msg);
goto error;
@@ -934,7 +933,7 @@ static int _BarFlyParseYear(char const* album_html, short unsigned* year,
status = regexec(&regex_year, album_html, MATCH_COUNT, match, 0);
if (status != 0) {
regerror(status, &regex_year, error_msg, ERROR_MSG_SIZE);
- BarUiMsg(settings, MSG_DEBUG, "The year was not included in the album "
+ BarUiMsg(settings, MSG_INFO, "The year was not included in the album "
"detail page (%d:%s).\n", status, error_msg);
goto error;
}
@@ -1231,7 +1230,7 @@ static int _BarFlyTagWrite(BarFly_t const* fly, BarSettings_t const* settings)
status = _BarFlyTagFetchCover(&cover_art, &cover_size,
fly->cover_art_url, settings);
if (status != 0) {
- BarUiMsg(settings, MSG_DEBUG, "The cover art will not be addded to "
+ BarUiMsg(settings, MSG_INFO, "The cover art will not be addded to "
"the tag.\n");
exit_status = -1;
}
@@ -1246,7 +1245,6 @@ static int _BarFlyTagWrite(BarFly_t const* fly, BarSettings_t const* settings)
#if defined ENABLE_MAD && defined ENABLE_ID3TAG
case PIANO_AF_MP3:
- case PIANO_AF_MP3_HI:
status = _BarFlyTagID3Write(fly, cover_art, cover_size, settings);
break;
#endif
@@ -1256,7 +1254,7 @@ static int _BarFlyTagWrite(BarFly_t const* fly, BarSettings_t const* settings)
* If the taging library was not enabled for the audio format being
* played just error out. Don't report an error.
*/
- BarUiMsg(settings, MSG_DEBUG, "The file was not tagged since the"
+ BarUiMsg(settings, MSG_INFO, "The file was not tagged since the"
"tagging library was not linked in.\n");
goto error;
break;
@@ -1481,7 +1479,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
xml_pos = strstr(song->songExplorerUrl, XML_STRING);
if (xml_pos == NULL) {
- BarUiMsg(settings, MSG_DEBUG, "The song explorer URL did not contain "
+ BarUiMsg(settings, MSG_INFO, "The song explorer URL did not contain "
"the expected \"/xml/\" substring. The cover art will not be "
"added to the tag.\n");
exit_status = -1;
@@ -1492,7 +1490,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
(int)(xml_pos - song->songExplorerUrl), song->songExplorerUrl,
(int)(question_pos - xml_pos) - xml_len, xml_pos + xml_len);
if (status == -1) {
- BarUiMsg(settings, MSG_DEBUG, "Error copying the song content URL. "
+ BarUiMsg(settings, MSG_INFO, "Error copying the song content URL. "
"The cover art will not be added to the tag. (%d:%s)\n",
errno, strerror(errno));
exit_status = -1;
@@ -1502,7 +1500,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
status = _BarFlyFetchURL(song_content_url, (uint8_t**)&buffer, NULL,
settings);
if (status != 0) {
- BarUiMsg(settings, MSG_DEBUG, "Couldn't get the song content "
+ BarUiMsg(settings, MSG_INFO, "Couldn't get the song content "
"page. The cover art will not be added to the tag.\n");
exit_status = -1;
}
@@ -1511,7 +1509,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
// status = _BarFlyParseYear(album_buf, &output_fly.year,
// settings);
// if (status != 0) {
-// BarUiMsg(settings, MSG_DEBUG, "The album release year will "
+// BarUiMsg(settings, MSG_INFO, "The album release year will "
// "not be added to the tag.\n");
// exit_status = -1;
// }
@@ -1519,7 +1517,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
output_fly.cover_art_url = _BarFlyParseCoverArtURL(buffer,
settings);
if (output_fly.cover_art_url == NULL) {
- BarUiMsg(settings, MSG_DEBUG, "The cover art will not be "
+ BarUiMsg(settings, MSG_INFO, "The cover art will not be "
"addded to the tag.\n");
exit_status = -1;
}
@@ -1536,7 +1534,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
status = _BarFlyFetchURL(song->albumExplorerUrl, (uint8_t**)&buffer,
NULL, settings);
if (status != 0) {
- BarUiMsg(settings, MSG_DEBUG, "Couldn't get the album explorer page. "
+ BarUiMsg(settings, MSG_INFO, "Couldn't get the album explorer page. "
"The track and disc numbers will not be added to the tag.\n");
exit_status = -1;
}
@@ -1545,7 +1543,7 @@ int BarFlyOpen(BarFly_t* fly, PianoSong_t const* song,
status = _BarFlyParseTrackDisc(song->title, buffer,
&output_fly.track, &output_fly.disc, settings);
if (status != 0) {
- BarUiMsg(settings, MSG_DEBUG, "The track and disc numbers will not "
+ BarUiMsg(settings, MSG_INFO, "The track and disc numbers will not "
"be added to the tag.\n");
exit_status = -1;
}
View
2  src/fly.h
@@ -212,5 +212,3 @@ int BarFlyTag(BarFly_t* fly, BarSettings_t const* settings);
int BarFlyWrite(BarFly_t* fly, void const* data, size_t data_size);
#endif /* _FLY_H */
-
-// vim: set noexpandtab:
View
5 src/fly_mp4.c
@@ -2035,6 +2035,11 @@ int BarFlyMp4TagWrite(BarFlyMp4Tag_t* tag, BarSettings_t const* settings)
goto end;
error:
+ /*
+ * Delete the tmp file if it exists.
+ */
+ unlink(tmp_file_path);
+
exit_status = -1;
end:
View
20 src/libezxml/COPYING
@@ -1,20 +0,0 @@
-Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
View
718 src/libezxml/ezxml.c
@@ -1,718 +0,0 @@
-/* ezxml.c
- *
- * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef __FreeBSD__
-#define _BSD_SOURCE /* required by strdup() */
-#define _DARWIN_C_SOURCE /* required by strdup() on OS X */
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "ezxml.h"
-
-#define EZXML_WS "\t\r\n " // whitespace
-#define EZXML_ERRL 128 // maximum error string length
-
-typedef struct ezxml_root *ezxml_root_t;
-struct ezxml_root { // additional data for the root tag
- struct ezxml xml; // is a super-struct built on top of ezxml struct
- ezxml_t cur; // current xml tree insertion point
- char *m; // original xml string
- size_t len; // length of allocated memory for mmap, -1 for malloc
- char *u; // UTF-8 conversion of string if original was UTF-16
- char *s; // start of work area
- char *e; // end of work area
- char **ent; // general entities (ampersand sequences)
- char ***attr; // default attributes
- char ***pi; // processing instructions
- short standalone; // non-zero if <?xml standalone="yes"?>
- char err[EZXML_ERRL]; // error string
-};
-
-char *EZXML_NIL[] = { NULL }; // empty, null terminated array of strings
-
-// sets a flag for the given tag and returns the tag
-static ezxml_t ezxml_set_flag(ezxml_t xml, short flag) {
- if (xml) xml->flags |= flag;
- return xml;
-}
-
-// inserts an existing tag into an ezxml structure
-static ezxml_t ezxml_insert(ezxml_t xml, ezxml_t dest, size_t off)
-{
- ezxml_t cur, prev, head;
-
- xml->next = xml->sibling = xml->ordered = NULL;
- xml->off = off;
- xml->parent = dest;
-
- if ((head = dest->child)) { // already have sub tags
- if (head->off <= off) { // not first subtag
- for (cur = head; cur->ordered && cur->ordered->off <= off;
- cur = cur->ordered);
- xml->ordered = cur->ordered;
- cur->ordered = xml;
- }
- else { // first subtag
- xml->ordered = head;
- dest->child = xml;
- }
-
- for (cur = head, prev = NULL; cur && strcmp(cur->name, xml->name);
- prev = cur, cur = cur->sibling); // find tag type
- if (cur && cur->off <= off) { // not first of type
- while (cur->next && cur->next->off <= off) cur = cur->next;
- xml->next = cur->next;
- cur->next = xml;
- }
- else { // first tag of this type
- if (prev && cur) prev->sibling = cur->sibling; // remove old first
- xml->next = cur; // old first tag is now next
- for (cur = head, prev = NULL; cur && cur->off <= off;
- prev = cur, cur = cur->sibling); // new sibling insert point
- xml->sibling = cur;
- if (prev) prev->sibling = xml;
- }
- }
- else dest->child = xml; // only sub tag
-
- return xml;
-}
-
-// Adds a child tag. off is the offset of the child tag relative to the start
-// of the parent tag's character content. Returns the child tag.
-static ezxml_t ezxml_add_child(ezxml_t xml, const char *name, size_t off)
-{
- ezxml_t child;
-
- if (! xml) return NULL;
- child = (ezxml_t)memset(malloc(sizeof(struct ezxml)), '\0',
- sizeof(struct ezxml));
- child->name = (char *)name;
- child->attr = EZXML_NIL;
- child->txt = "";
-
- return ezxml_insert(child, xml, off);
-}
-
-// returns the first child tag with the given name or NULL if not found
-ezxml_t ezxml_child(ezxml_t xml, const char *name)
-{
- xml = (xml) ? xml->child : NULL;
- while (xml && strcmp(name, xml->name)) xml = xml->sibling;
- return xml;
-}
-
-// returns a new empty ezxml structure with the given root tag name
-static ezxml_t ezxml_new(const char *name)
-{
- static char *ent[] = { "lt;", "&#60;", "gt;", "&#62;", "quot;", "&#34;",
- "apos;", "&#39;", "amp;", "&#38;", NULL };
- ezxml_root_t root = (ezxml_root_t)memset(malloc(sizeof(struct ezxml_root)),
- '\0', sizeof(struct ezxml_root));
- root->xml.name = (char *)name;
- root->cur = &root->xml;
- strcpy(root->err, root->xml.txt = "");
- root->ent = memcpy(malloc(sizeof(ent)), ent, sizeof(ent));
- root->attr = root->pi = (char ***)(root->xml.attr = EZXML_NIL);
- return &root->xml;
-}
-
-// returns the Nth tag with the same name in the same subsection or NULL if not
-// found
-ezxml_t ezxml_idx(ezxml_t xml, int idx)
-{
- for (; xml && idx; idx--) xml = xml->next;
- return xml;
-}
-
-// returns the value of the requested tag attribute or NULL if not found
-const char *ezxml_attr(ezxml_t xml, const char *attr)
-{
- int i = 0, j = 1;
- ezxml_root_t root = (ezxml_root_t)xml;
-
- if (! xml || ! xml->attr) return NULL;
- while (xml->attr[i] && strcmp(attr, xml->attr[i])) i += 2;
- if (xml->attr[i]) return xml->attr[i + 1]; // found attribute
-
- while (root->xml.parent) root = (ezxml_root_t)root->xml.parent; // root tag
- for (i = 0; root->attr[i] && strcmp(xml->name, root->attr[i][0]); i++);
- if (! root->attr[i]) return NULL; // no matching default attributes
- while (root->attr[i][j] && strcmp(attr, root->attr[i][j])) j += 3;
- return (root->attr[i][j]) ? root->attr[i][j + 1] : NULL; // found default
-}
-
-// same as ezxml_get but takes an already initialized va_list
-static ezxml_t ezxml_vget(ezxml_t xml, va_list ap)
-{
- char *name = va_arg(ap, char *);
- int idx = -1;
-
- if (name && *name) {
- idx = va_arg(ap, int);
- xml = ezxml_child(xml, name);
- }
- return (idx < 0) ? xml : ezxml_vget(ezxml_idx(xml, idx), ap);
-}
-
-// Traverses the xml tree to retrieve a specific subtag. Takes a variable
-// length list of tag names and indexes. The argument list must be terminated
-// by either an index of -1 or an empty string tag name. Example:
-// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1);
-// This retrieves the title of the 3rd book on the 1st shelf of library.
-// Returns NULL if not found.
-ezxml_t ezxml_get(ezxml_t xml, ...)
-{
- va_list ap;
- ezxml_t r;
-
- va_start(ap, xml);
- r = ezxml_vget(xml, ap);
- va_end(ap);
- return r;
-}
-
-// set an error string and return root
-static ezxml_t ezxml_err(ezxml_root_t root, char *s, const char *err, ...)
-{
- va_list ap;
- int line = 1;
- char *t, fmt[EZXML_ERRL];
-
- for (t = root->s; t < s; t++) if (*t == '\n') line++;
- snprintf(fmt, EZXML_ERRL, "[error near line %d]: %s", line, err);
-
- va_start(ap, err);
- vsnprintf(root->err, EZXML_ERRL, fmt, ap);
- va_end(ap);
-
- return &root->xml;
-}
-
-// Recursively decodes entity and character references and normalizes new lines
-// ent is a null terminated array of alternating entity names and values. set t
-// to '&' for general entity decoding, '%' for parameter entity decoding, 'c'
-// for cdata sections, ' ' for attribute normalization, or '*' for non-cdata
-// attribute normalization. Returns s, or if the decoded string is longer than
-// s, returns a malloced string that must be freed.
-static char *ezxml_decode(char *s, char **ent, char t)
-{
- char *e, *r = s, *m = s;
- long b, c, d, l;
-
- for (; *s; s++) { // normalize line endings
- while (*s == '\r') {
- *(s++) = '\n';
- if (*s == '\n') memmove(s, (s + 1), strlen(s));
- }
- }
-
- for (s = r; ; ) {
- while (*s && *s != '&' && (*s != '%' || t != '%') && !isspace(*s)) s++;
-
- if (! *s) break;
- else if (t != 'c' && ! strncmp(s, "&#", 2)) { // character reference
- if (s[2] == 'x') c = strtol(s + 3, &e, 16); // base 16
- else c = strtol(s + 2, &e, 10); // base 10
- if (! c || *e != ';') { s++; continue; } // not a character ref
-
- if (c < 0x80) *(s++) = c; // US-ASCII subset
- else { // multi-byte UTF-8 sequence
- for (b = 0, d = c; d; d /= 2) b++; // number of bits in c
- b = (b - 2) / 5; // number of bytes in payload
- *(s++) = (0xFF << (7 - b)) | (c >> (6 * b)); // head
- while (b) *(s++) = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload
- }
-
- memmove(s, strchr(s, ';') + 1, strlen(strchr(s, ';')));
- }
- else if ((*s == '&' && (t == '&' || t == ' ' || t == '*')) ||
- (*s == '%' && t == '%')) { // entity reference
- for (b = 0; ent[b] && strncmp(s + 1, ent[b], strlen(ent[b]));
- b += 2); // find entity in entity list
-
- if (ent[b++]) { // found a match
- if ((c = strlen(ent[b])) - 1 > (e = strchr(s, ';')) - s) {
- l = (d = (s - r)) + c + strlen(e); // new length
- r = (r == m) ? strcpy(malloc(l), r) : realloc(r, l);
- e = strchr((s = r + d), ';'); // fix up pointers
- }
-
- memmove(s + c, e + 1, strlen(e)); // shift rest of string
- strncpy(s, ent[b], c); // copy in replacement text
- }
- else s++; // not a known entity
- }
- else if ((t == ' ' || t == '*') && isspace(*s)) *(s++) = ' ';
- else s++; // no decoding needed
- }
-
- if (t == '*') { // normalize spaces for non-cdata attributes
- for (s = r; *s; s++) {
- if ((l = strspn(s, " "))) memmove(s, s + l, strlen(s + l) + 1);
- while (*s && *s != ' ') s++;
- }
- if (--s >= r && *s == ' ') *s = '\0'; // trim any trailing space
- }
- return r;
-}
-
-// called when parser finds start of new tag
-static void ezxml_open_tag(ezxml_root_t root, char *name, char **attr)
-{
- ezxml_t xml = root->cur;
-
- if (xml->name) xml = ezxml_add_child(xml, name, strlen(xml->txt));
- else xml->name = name; // first open tag
-
- xml->attr = attr;
- root->cur = xml; // update tag insertion point
-}
-
-// called when parser finds character content between open and closing tag
-static void ezxml_char_content(ezxml_root_t root, char *s, size_t len, char t)
-{
- ezxml_t xml = root->cur;
- char *m = s;
- size_t l;
-
- if (! xml || ! xml->name || ! len) return; // sanity check
-
- s[len] = '\0'; // null terminate text (calling functions anticipate this)
- len = strlen(s = ezxml_decode(s, root->ent, t)) + 1;
-
- if (! *(xml->txt)) xml->txt = s; // initial character content
- else { // allocate our own memory and make a copy
- xml->txt = (xml->flags & EZXML_TXTM) // allocate some space
- ? realloc(xml->txt, (l = strlen(xml->txt)) + len)
- : strcpy(malloc((l = strlen(xml->txt)) + len), xml->txt);
- strcpy(xml->txt + l, s); // add new char content
- if (s != m) free(s); // free s if it was malloced by ezxml_decode()
- }
-
- if (xml->txt != m) ezxml_set_flag(xml, EZXML_TXTM);
-}
-
-// called when parser finds closing tag
-static ezxml_t ezxml_close_tag(ezxml_root_t root, char *name, char *s)
-{
- if (! root->cur || ! root->cur->name || strcmp(name, root->cur->name))
- return ezxml_err(root, s, "unexpected closing tag </%s>", name);
-
- root->cur = root->cur->parent;
- return NULL;
-}
-
-// checks for circular entity references, returns non-zero if no circular
-// references are found, zero otherwise
-static int ezxml_ent_ok(char *name, char *s, char **ent)
-{
- int i;
-
- for (; ; s++) {
- while (*s && *s != '&') s++; // find next entity reference
- if (! *s) return 1;
- if (! strncmp(s + 1, name, strlen(name))) return 0; // circular ref.
- for (i = 0; ent[i] && strncmp(ent[i], s + 1, strlen(ent[i])); i += 2);
- if (ent[i] && ! ezxml_ent_ok(name, ent[i + 1], ent)) return 0;
- }
-}
-
-// called when the parser finds a processing instruction
-static void ezxml_proc_inst(ezxml_root_t root, char *s, size_t len)
-{
- int i = 0, j = 1;
- char *target = s;
-
- s[len] = '\0'; // null terminate instruction
- if (*(s += strcspn(s, EZXML_WS))) {
- *s = '\0'; // null terminate target
- s += strspn(s + 1, EZXML_WS) + 1; // skip whitespace after target
- }
-
- if (! strcmp(target, "xml")) { // <?xml ... ?>
- if ((s = strstr(s, "standalone")) && ! strncmp(s + strspn(s + 10,
- EZXML_WS "='\"") + 10, "yes", 3)) root->standalone = 1;
- return;
- }
-
- if (! root->pi[0]) *(root->pi = malloc(sizeof(char **))) = NULL; //first pi
-
- while (root->pi[i] && strcmp(target, root->pi[i][0])) i++; // find target
- if (! root->pi[i]) { // new target
- root->pi = realloc(root->pi, sizeof(char **) * (i + 2));
- root->pi[i] = malloc(sizeof(char *) * 3);
- root->pi[i][0] = target;
- root->pi[i][1] = (char *)(root->pi[i + 1] = NULL); // terminate pi list
- root->pi[i][2] = strdup(""); // empty document position list
- }
-
- while (root->pi[i][j]) j++; // find end of instruction list for this target
- root->pi[i] = realloc(root->pi[i], sizeof(char *) * (j + 3));
- root->pi[i][j + 2] = realloc(root->pi[i][j + 1], j + 1);
- strcpy(root->pi[i][j + 2] + j - 1, (root->xml.name) ? ">" : "<");
- root->pi[i][j + 1] = NULL; // null terminate pi list for this target
- root->pi[i][j] = s; // set instruction
-}
-
-// called when the parser finds an internal doctype subset
-static short ezxml_internal_dtd(ezxml_root_t root, char *s, size_t len)
-{
- char q, *c, *t, *n = NULL, *v, **ent, **pe;
- int i, j;
-
- pe = memcpy(malloc(sizeof(EZXML_NIL)), EZXML_NIL, sizeof(EZXML_NIL));
-
- for (s[len] = '\0'; s; ) {
- while (*s && *s != '<' && *s != '%') s++; // find next declaration
-
- if (! *s) break;
- else if (! strncmp(s, "<!ENTITY", 8)) { // parse entity definitions
- c = s += strspn(s + 8, EZXML_WS) + 8; // skip white space separator
- n = s + strspn(s, EZXML_WS "%"); // find name
- *(s = n + strcspn(n, EZXML_WS)) = ';'; // append ; to name
-
- v = s + strspn(s + 1, EZXML_WS) + 1; // find value
- if ((q = *(v++)) != '"' && q != '\'') { // skip externals
- s = strchr(s, '>');
- continue;
- }
-
- for (i = 0, ent = (*c == '%') ? pe : root->ent; ent[i]; i++);
- ent = realloc(ent, (i + 3) * sizeof(char *)); // space for next ent
- if (*c == '%') pe = ent;
- else root->ent = ent;
-
- *(++s) = '\0'; // null terminate name
- if ((s = strchr(v, q))) *(s++) = '\0'; // null terminate value
- ent[i + 1] = ezxml_decode(v, pe, '%'); // set value
- ent[i + 2] = NULL; // null terminate entity list
- if (! ezxml_ent_ok(n, ent[i + 1], ent)) { // circular reference
- if (ent[i + 1] != v) free(ent[i + 1]);
- ezxml_err(root, v, "circular entity declaration &%s", n);
- break;
- }
- else ent[i] = n; // set entity name
- }
- else if (! strncmp(s, "<!ATTLIST", 9)) { // parse default attributes
- t = s + strspn(s + 9, EZXML_WS) + 9; // skip whitespace separator
- if (! *t) { ezxml_err(root, t, "unclosed <!ATTLIST"); break; }
- if (*(s = t + strcspn(t, EZXML_WS ">")) == '>') continue;
- else *s = '\0'; // null terminate tag name
- for (i = 0; root->attr[i] && strcmp(n, root->attr[i][0]); i++);
-
- ++s; // ansi cpr
- while (*(n = s + strspn(s, EZXML_WS)) && *n != '>') {
- if (*(s = n + strcspn(n, EZXML_WS))) *s = '\0'; // attr name
- else { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- s += strspn(s + 1, EZXML_WS) + 1; // find next token
- c = (strncmp(s, "CDATA", 5)) ? "*" : " "; // is it cdata?
- if (! strncmp(s, "NOTATION", 8))
- s += strspn(s + 8, EZXML_WS) + 8;
- s = (*s == '(') ? strchr(s, ')') : s + strcspn(s, EZXML_WS);
- if (! s) { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- s += strspn(s, EZXML_WS ")"); // skip white space separator
- if (! strncmp(s, "#FIXED", 6))
- s += strspn(s + 6, EZXML_WS) + 6;
- if (*s == '#') { // no default value
- s += strcspn(s, EZXML_WS ">") - 1;
- if (*c == ' ') continue; // cdata is default, nothing to do
- v = NULL;
- }
- else if ((*s == '"' || *s == '\'') && // default value
- (s = strchr(v = s + 1, *s))) *s = '\0';
- else { ezxml_err(root, t, "malformed <!ATTLIST"); break; }
-
- if (! root->attr[i]) { // new tag name
- root->attr = (! i) ? malloc(2 * sizeof(char **))
- : realloc(root->attr,
- (i + 2) * sizeof(char **));
- root->attr[i] = malloc(2 * sizeof(char *));
- root->attr[i][0] = t; // set tag name
- root->attr[i][1] = (char *)(root->attr[i + 1] = NULL);
- }
-
- for (j = 1; root->attr[i][j]; j += 3); // find end of list
- root->attr[i] = realloc(root->attr[i],
- (j + 4) * sizeof(char *));
-
- root->attr[i][j + 3] = NULL; // null terminate list
- root->attr[i][j + 2] = c; // is it cdata?
- root->attr[i][j + 1] = (v) ? ezxml_decode(v, root->ent, *c)
- : NULL;
- root->attr[i][j] = n; // attribute name
- ++s;
- }
- }
- else if (! strncmp(s, "<!--", 4)) s = strstr(s + 4, "-->"); // comments
- else if (! strncmp(s, "<?", 2)) { // processing instructions
- if ((s = strstr(c = s + 2, "?>")))
- ezxml_proc_inst(root, c, s++ - c);
- }
- else if (*s == '<') s = strchr(s, '>'); // skip other declarations
- else if (*(s++) == '%' && ! root->standalone) break;
- }
-
- free(pe);
- return ! *root->err;
-}
-
-// Converts a UTF-16 string to UTF-8. Returns a new string that must be freed
-// or NULL if no conversion was needed.
-static char *ezxml_str2utf8(char **s, size_t *len)
-{
- char *u;
- size_t l = 0, sl, max = *len;
- long c, d;
- int b, be = (**s == '\xFE') ? 1 : (**s == '\xFF') ? 0 : -1;
-
- if (be == -1) return NULL; // not UTF-16
-
- u = malloc(max);
- for (sl = 2; sl < *len - 1; sl += 2) {
- c = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF) //UTF-16BE
- : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF); //UTF-16LE
- if (c >= 0xD800 && c <= 0xDFFF && (sl += 2) < *len - 1) { // high-half
- d = (be) ? (((*s)[sl] & 0xFF) << 8) | ((*s)[sl + 1] & 0xFF)
- : (((*s)[sl + 1] & 0xFF) << 8) | ((*s)[sl] & 0xFF);
- c = (((c & 0x3FF) << 10) | (d & 0x3FF)) + 0x10000;
- }
-
- while (l + 6 > max) u = realloc(u, max += EZXML_BUFSIZE);
- if (c < 0x80) u[l++] = c; // US-ASCII subset
- else { // multi-byte UTF-8 sequence
- for (b = 0, d = c; d; d /= 2) b++; // bits in c
- b = (b - 2) / 5; // bytes in payload
- u[l++] = (0xFF << (7 - b)) | (c >> (6 * b)); // head
- while (b) u[l++] = 0x80 | ((c >> (6 * --b)) & 0x3F); // payload
- }
- }
- return *s = realloc(u, *len = l);
-}
-
-// frees a tag attribute list
-static void ezxml_free_attr(char **attr) {
- int i = 0;
- char *m;
-
- if (! attr || attr == EZXML_NIL) return; // nothing to free
- while (attr[i]) i += 2; // find end of attribute list
- m = attr[i + 1]; // list of which names and values are malloced
- for (i = 0; m[i]; i++) {
- if (m[i] & EZXML_NAMEM) free(attr[i * 2]);
- if (m[i] & EZXML_TXTM) free(attr[(i * 2) + 1]);
- }
- free(m);
- free(attr);
-}
-
-// parse the given xml string and return an ezxml structure
-ezxml_t ezxml_parse_str(char *s, size_t len)
-{
- ezxml_root_t root = (ezxml_root_t)ezxml_new(NULL);
- char q, e, *d, **attr, **a = NULL; // initialize a to avoid compile warning
- int l, i, j;
-
- root->m = s;
- if (! len) return ezxml_err(root, NULL, "root tag missing");
- root->u = ezxml_str2utf8(&s, &len); // convert utf-16 to utf-8
- root->e = (root->s = s) + len; // record start and end of work area
-
- e = s[len - 1]; // save end char
- s[len - 1] = '\0'; // turn end char into null terminator
-
- while (*s && *s != '<') s++; // find first tag
- if (! *s) return ezxml_err(root, s, "root tag missing");
-
- for (; ; ) {
- attr = (char **)EZXML_NIL;
- d = ++s;
-
- if (isalpha(*s) || *s == '_' || *s == ':' || *s < '\0') { // new tag
- if (! root->cur)
- return ezxml_err(root, d, "markup outside of root element");
-
- s += strcspn(s, EZXML_WS "/>");
- while (isspace(*s)) *(s++) = '\0'; // null terminate tag name
-
- if (*s && *s != '/' && *s != '>') // find tag in default attr list
- for (i = 0; (a = root->attr[i]) && strcmp(a[0], d); i++);
-
- for (l = 0; *s && *s != '/' && *s != '>'; l += 2) { // new attrib
- attr = (l) ? realloc(attr, (l + 4) * sizeof(char *))
- : malloc(4 * sizeof(char *)); // allocate space
- attr[l + 3] = (l) ? realloc(attr[l + 1], (l / 2) + 2)
- : malloc(2); // mem for list of maloced vals
- strcpy(attr[l + 3] + (l / 2), " "); // value is not malloced
- attr[l + 2] = NULL; // null terminate list
- attr[l + 1] = ""; // temporary attribute value
- attr[l] = s; // set attribute name
-
- s += strcspn(s, EZXML_WS "=/>");
- if (*s == '=' || isspace(*s)) {
- *(s++) = '\0'; // null terminate tag attribute name
- q = *(s += strspn(s, EZXML_WS "="));
- if (q == '"' || q == '\'') { // attribute value
- attr[l + 1] = ++s;
- while (*s && *s != q) s++;
- if (*s) *(s++) = '\0'; // null terminate attribute val
- else {
- ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing %c", q);
- }
-
- for (j = 1; a && a[j] && strcmp(a[j], attr[l]); j +=3);
- attr[l + 1] = ezxml_decode(attr[l + 1], root->ent, (a
- && a[j]) ? *a[j + 2] : ' ');
- if (attr[l + 1] < d || attr[l + 1] > s)
- attr[l + 3][l / 2] = EZXML_TXTM; // value malloced
- }
- }
- while (isspace(*s)) s++;
- }
-
- if (*s == '/') { // self closing tag
- *(s++) = '\0';
- if ((*s && *s != '>') || (! *s && e != '>')) {
- if (l) ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing >");
- }
- ezxml_open_tag(root, d, attr);
- ezxml_close_tag(root, d, s);
- }
- else if ((q = *s) == '>' || (! *s && e == '>')) { // open tag
- *s = '\0'; // temporarily null terminate tag name
- ezxml_open_tag(root, d, attr);
- *s = q;
- }
- else {
- if (l) ezxml_free_attr(attr);
- return ezxml_err(root, d, "missing >");
- }
- }
- else if (*s == '/') { // close tag
- s += strcspn(d = s + 1, EZXML_WS ">") + 1;
- if (! (q = *s) && e != '>') return ezxml_err(root, d, "missing >");
- *s = '\0'; // temporarily null terminate tag name
- if (ezxml_close_tag(root, d, s)) return &root->xml;
- if (isspace(*s = q)) s += strspn(s, EZXML_WS);
- }
- else if (! strncmp(s, "!--", 3)) { // xml comment
- if (! (s = strstr(s + 3, "--")) || (*(s += 2) != '>' && *s) ||
- (! *s && e != '>')) return ezxml_err(root, d, "unclosed <!--");
- }
- else if (! strncmp(s, "![CDATA[", 8)) { // cdata
- if ((s = strstr(s, "]]>")))
- ezxml_char_content(root, d + 8, (s += 2) - d - 10, 'c');
- else return ezxml_err(root, d, "unclosed <![CDATA[");
- }
- else if (! strncmp(s, "!DOCTYPE", 8)) { // dtd
- for (l = 0; *s && ((! l && *s != '>') || (l && (*s != ']' ||
- *(s + strspn(s + 1, EZXML_WS) + 1) != '>')));
- l = (*s == '[') ? 1 : l) s += strcspn(s + 1, "[]>") + 1;
- if (! *s && e != '>')
- return ezxml_err(root, d, "unclosed <!DOCTYPE");
- d = (l) ? strchr(d, '[') + 1 : d;
- if (l && ! ezxml_internal_dtd(root, d, s++ - d)) return &root->xml;
- }
- else if (*s == '?') { // <?...?> processing instructions
- do { s = strchr(s, '?'); } while (s && *(++s) && *s != '>');
- if (! s || (! *s && e != '>'))
- return ezxml_err(root, d, "unclosed <?");
- else ezxml_proc_inst(root, d + 1, s - d - 2);
- }
- else return ezxml_err(root, d, "unexpected <");
-
- if (! s || ! *s) break;
- *s = '\0';
- d = ++s;
- if (*s && *s != '<') { // tag character content
- while (*s && *s != '<') s++;
- if (*s) ezxml_char_content(root, d, s - d, '&');
- else break;
- }
- else if (! *s) break;
- }
-
- if (! root->cur) return &root->xml;
- else if (! root->cur->name) return ezxml_err(root, d, "root tag missing");
- else return ezxml_err(root, d, "unclosed tag <%s>", root->cur->name);
-}
-
-// free the memory allocated for the ezxml structure
-void ezxml_free(ezxml_t xml)
-{
- ezxml_root_t root = (ezxml_root_t)xml;
- int i, j;
- char **a, *s;
-
- if (! xml) return;
- ezxml_free(xml->child);
- ezxml_free(xml->ordered);
-
- if (! xml->parent) { // free root tag allocations
- for (i = 10; root->ent[i]; i += 2) // 0 - 9 are default entites (<>&"')
- if ((s = root->ent[i + 1]) < root->s || s > root->e) free(s);
- free(root->ent); // free list of general entities
-
- for (i = 0; (a = root->attr[i]); i++) {
- for (j = 1; a[j++]; j += 2) // free malloced attribute values
- if (a[j] && (a[j] < root->s || a[j] > root->e)) free(a[j]);
- free(a);
- }
- if (root->attr[0]) free(root->attr); // free default attribute list
-
- for (i = 0; root->pi[i]; i++) {
- for (j = 1; root->pi[i][j]; j++);
- free(root->pi[i][j + 1]);
- free(root->pi[i]);
- }
- if (root->pi[0]) free(root->pi); // free processing instructions
-
- if (root->len == -1) free(root->m); // malloced xml data
- if (root->u) free(root->u); // utf8 conversion
- }
-
- ezxml_free_attr(xml->attr); // tag attributes
- if ((xml->flags & EZXML_TXTM)) free(xml->txt); // character content
- if ((xml->flags & EZXML_NAMEM)) free(xml->name); // tag name
- free(xml);
-}
-
-// return parser error message or empty string if none
-const char *ezxml_error(ezxml_t xml)
-{
- while (xml && xml->parent) xml = xml->parent; // find root tag
- return (xml) ? ((ezxml_root_t)xml)->err : "";
-}
-
View
93 src/libezxml/ezxml.h
@@ -1,93 +0,0 @@
-/* ezxml.h
- *
- * Copyright 2004-2006 Aaron Voisine <aaron@voisine.org>
- *
- * Permission is hereby granted, free of charge, to any person obtaining
- * a copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sublicense, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice shall be included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
- * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
- * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _EZXML_H
-#define _EZXML_H
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <fcntl.h>
-
-#define EZXML_BUFSIZE 1024 // size of internal memory buffers
-#define EZXML_NAMEM 0x80 // name is malloced
-#define EZXML_TXTM 0x40 // txt is malloced
-#define EZXML_DUP 0x20 // attribute name and value are strduped
-
-typedef struct ezxml *ezxml_t;
-struct ezxml {
- char *name; // tag name
- char **attr; // tag attributes { name, value, name, value, ... NULL }
- char *txt; // tag character content, empty string if none
- size_t off; // tag offset from start of parent tag character content
- ezxml_t next; // next tag with same name in this section at this depth
- ezxml_t sibling; // next tag with different name in same section and depth
- ezxml_t ordered; // next tag, same section and depth, in original order
- ezxml_t child; // head of sub tag list, NULL if none
- ezxml_t parent; // parent tag, NULL if current tag is root tag
- short flags; // additional information
-};
-
-// Given a string of xml data and its length, parses it and creates an ezxml
-// structure. For efficiency, modifies the data by adding null terminators
-// and decoding ampersand sequences. If you don't want this, copy the data and
-// pass in the copy. Returns NULL on failure.
-ezxml_t ezxml_parse_str(char *s, size_t len);
-
-// returns the first child tag (one level deeper) with the given name or NULL
-// if not found
-ezxml_t ezxml_child(ezxml_t xml, const char *name);
-
-// returns the next tag of the same name in the same section and depth or NULL
-// if not found
-#define ezxml_next(xml) ((xml) ? xml->next : NULL)
-
-// Returns the Nth tag with the same name in the same section at the same depth
-// or NULL if not found. An index of 0 returns the tag given.
-ezxml_t ezxml_idx(ezxml_t xml, int idx);
-
-// returns the name of the given tag
-#define ezxml_name(xml) ((xml) ? xml->name : NULL)
-
-// returns the given tag's character content or empty string if none
-#define ezxml_txt(xml) ((xml) ? xml->txt : "")
-
-// returns the value of the requested tag attribute, or NULL if not found
-const char *ezxml_attr(ezxml_t xml, const char *attr);
-
-// Traverses the ezxml sturcture to retrieve a specific subtag. Takes a
-// variable length list of tag names and indexes. The argument list must be
-// terminated by either an index of -1 or an empty string tag name. Example:
-// title = ezxml_get(library, "shelf", 0, "book", 2, "title", -1);
-// This retrieves the title of the 3rd book on the 1st shelf of library.
-// Returns NULL if not found.
-ezxml_t ezxml_get(ezxml_t xml, ...);
-
-// frees the memory allocated for an ezxml structure
-void ezxml_free(ezxml_t xml);
-
-// returns parser error message or empty string if none
-const char *ezxml_error(ezxml_t xml);
-
-#endif // _EZXML_H
View
196 src/libpiano/crypt.c
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2008-2010
+Copyright (c) 2008-2012
Lars-Dominik Braun <lars@6xq.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -22,176 +22,76 @@ THE SOFTWARE.
*/
#include <string.h>
+#include <assert.h>
+#include <gcrypt.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
-#include <arpa/inet.h>
-#include "crypt_key_output.h"
-#include "crypt_key_input.h"
-#include "piano_private.h"
-
-#define byteswap32(x) ((((x) >> 24) & 0x000000ff) | \
- (((x) >> 8) & 0x0000ff00) | \
- (((x) << 8) & 0x00ff0000) | \
- (((x) << 24) & 0xff000000))
-
-#define hostToBigEndian32(x) htonl(x)
-#define bigToHostEndian32(x) ntohl(x)
+#include "crypt.h"
/* decrypt hex-encoded, blowfish-crypted string: decode 2 hex-encoded blocks,
* decrypt, byteswap
+ * @param gcrypt handle
* @param hex string
+ * @param decrypted string length (without trailing NUL)
* @return decrypted string or NULL
*/
-#define INITIAL_SHIFT 28
-#define SHIFT_DEC 4
-unsigned char *PianoDecryptString (const unsigned char *strInput) {
- /* hex-decode => strlen/2 + null-byte */
- uint32_t *iDecrypt;
- unsigned char *strDecrypted;
- unsigned char shift = INITIAL_SHIFT, intsDecoded = 0, j;
- /* blowfish blocks, 32-bit */
- uint32_t f, l, r, lrExchange;
-
- if ((iDecrypt = calloc (strlen ((char *) strInput)/2/sizeof (*iDecrypt)+1,
- sizeof (*iDecrypt))) == NULL) {
- return NULL;
+char *PianoDecryptString (gcry_cipher_hd_t h, const char * const input,
+ size_t * const retSize) {
+ size_t inputLen = strlen (input);
+ gcry_error_t gret;
+ unsigned char *output;
+ size_t outputLen = inputLen/2;
+
+ assert (inputLen%2 == 0);
+
+ output = calloc (outputLen+1, sizeof (*output));
+ /* hex decode */
+ for (size_t i = 0; i < outputLen; i++) {
+ char hex[3];
+ memcpy (hex, &input[i*2], 2);
+ hex[2] = '\0';
+ output[i] = strtol (hex, NULL, 16);
}
- strDecrypted = (unsigned char *) iDecrypt;
-
- while (*strInput != '\0') {
- /* hex-decode string */
- if (*strInput >= '0' && *strInput <= '9') {
- *iDecrypt |= (*strInput & 0x0f) << shift;
- } else if (*strInput >= 'a' && *strInput <= 'f') {
- /* 0xa (hex) = 10 (decimal), 'a' & 0x0f == 1 => +9 */
- *iDecrypt |= ((*strInput+9) & 0x0f) << shift;
- }
- if (shift > 0) {
- shift -= SHIFT_DEC;
- } else {
- shift = INITIAL_SHIFT;
- /* initialize next dword */
- *(++iDecrypt) = 0;
- ++intsDecoded;
- }
-
- /* two 32-bit hex-decoded boxes available => blowfish decrypt */
- if (intsDecoded == 2) {
- l = *(iDecrypt-2);
- r = *(iDecrypt-1);
-
- for (j = in_key_n + 1; j > 1; --j) {
- l ^= in_key_p [j];
-
- f = in_key_s [0][(l >> 24) & 0xff] +
- in_key_s [1][(l >> 16) & 0xff];
- f ^= in_key_s [2][(l >> 8) & 0xff];
- f += in_key_s [3][l & 0xff];
- r ^= f;
- /* exchange l & r */
- lrExchange = l;
- l = r;
- r = lrExchange;
- }
- /* exchange l & r */
- lrExchange = l;
- l = r;
- r = lrExchange;
- r ^= in_key_p [1];
- l ^= in_key_p [0];
-
- *(iDecrypt-2) = bigToHostEndian32 (l);
- *(iDecrypt-1) = bigToHostEndian32 (r);
-
- intsDecoded = 0;
- }
- ++strInput;
+
+ gret = gcry_cipher_decrypt (h, output, outputLen, NULL, 0);
+ if (gret) {
+ return NULL;
}
- return strDecrypted;
+ *retSize = outputLen;
+
+ return (char *) output;
}
-#undef INITIAL_SHIFT
-#undef SHIFT_DEC
/* blowfish-encrypt/hex-encode string
+ * @param gcrypt handle
* @param encrypt this
* @return encrypted, hex-encoded string
*/
-unsigned char *PianoEncryptString (const unsigned char *strInput) {
- const size_t strInputN = strlen ((char *) strInput);
- /* num of 64-bit blocks, rounded to next block */
- size_t blockN = strInputN / 8 + 1;
- uint32_t *blockInput, *blockPtr;
- /* output string */
- unsigned char *strHex, *hexPtr;
- const char *hexmap = "0123456789abcdef";
-
- if ((blockInput = calloc (blockN*2, sizeof (*blockInput))) == NULL) {
+char *PianoEncryptString (gcry_cipher_hd_t h, const char *s) {
+ unsigned char *paddedInput, *hexOutput;
+ size_t inputLen = strlen (s);
+ /* blowfish expects two 32 bit blocks */
+ size_t paddedInputLen = (inputLen % 8 == 0) ? inputLen : inputLen + (8-inputLen%8);
+ gcry_error_t gret;
+
+ paddedInput = calloc (paddedInputLen+1, sizeof (*paddedInput));
+ memcpy (paddedInput, s, inputLen);
+
+ gret = gcry_cipher_encrypt (h, paddedInput, paddedInputLen, NULL, 0);
+ if (gret) {
return NULL;
}
- blockPtr = blockInput;
- if ((strHex = calloc (blockN*8*2 + 1, sizeof (*strHex))) == NULL) {
- return NULL;
- }
- hexPtr = strHex;
-
- memcpy (blockInput, strInput, strInputN);
-
- while (blockN > 0) {
- /* encryption blocks */
- uint32_t f, lrExchange;
- register uint32_t l, r;
- int i;
-
- l = hostToBigEndian32 (*blockPtr);
- r = hostToBigEndian32 (*(blockPtr+1));
-
- /* encrypt blocks */
- for (i = 0; i < out_key_n; i++) {
- l ^= out_key_p[i];
-
- f = out_key_s[0][(l >> 24) & 0xff] +
- out_key_s[1][(l >> 16) & 0xff];
- f ^= out_key_s[2][(l >> 8) & 0xff];
- f += out_key_s[3][l & 0xff];
- r ^= f;
- /* exchange l & r */
- lrExchange = l;
- l = r;
- r = lrExchange;
- }
- /* exchange l & r again */
- lrExchange = l;
- l = r;
- r = lrExchange;
- r ^= out_key_p [out_key_n];
- l ^= out_key_p [out_key_n+1];
-
- /* swap bytes again... */
- l = byteswap32 (l);
- r = byteswap32 (r);
-
- /* hex-encode encrypted blocks */
- for (i = 0; i < 4; i++) {
- *hexPtr++ = hexmap[(l & 0xf0) >> 4];
- *hexPtr++ = hexmap[l & 0x0f];
- l >>= 8;
- }
- for (i = 0; i < 4; i++) {
- *hexPtr++ = hexmap[(r & 0xf0) >> 4];
- *hexPtr++ = hexmap[r & 0x0f];
- r >>= 8;
- }
-
- /* two! 32-bit blocks encrypted (l & r) */
- blockPtr += 2;
- --blockN;
+ hexOutput = calloc (paddedInputLen*2+1, sizeof (*hexOutput));
+ for (size_t i = 0; i < paddedInputLen; i++) {
+ snprintf ((char * restrict) &hexOutput[i*2], 3, "%02x", paddedInput[i]);
}
- free (blockInput);
+ free (paddedInput);
- return strHex;
+ return (char *) hexOutput;
}
+
View
9 src/libpiano/crypt.h
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2008-2010
+Copyright (c) 2008-2011
Lars-Dominik Braun <lars@6xq.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -24,7 +24,10 @@ THE SOFTWARE.
#ifndef _CRYPH_H
#define _CRYPT_H
-char *PianoDecryptString (const char *strInput);
-char *PianoEncryptString (const char *strInput);
+#include <gcrypt.h>
+
+char *PianoDecryptString (gcry_cipher_hd_t, const char * const,
+ size_t * const);
+char *PianoEncryptString (gcry_cipher_hd_t, const char *);
#endif /* _CRYPT_H */
View
219 src/libpiano/crypt_key_input.h
@@ -1,219 +0,0 @@
-/*
-Copyright (c) 2008-2010
- Lars-Dominik Braun <lars@6xq.net>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-#ifndef _CRYPT_KEY_INPUT_H
-#define _CRYPT_KEY_INPUT_H
-
-#include <stdint.h>
-
-/* decryption key for last 48 bytes of audio urls
- * search for rpc.input in the decompiled pandora actionscript
- */
-
-const unsigned int in_key_n = 16;
-
-static const uint32_t in_key_p [16 + 2] = {
- 0xD825B592, 0xA73D0737, 0x3F7C28AE, 0xF91F7116, 0xEF6B001E, 0xD38524FD,
- 0x547F01EC, 0xE9C9DF7C, 0x25DE8E97, 0x9F45FF21, 0x87479245, 0x74A5FE7A,
- 0x9D4A1EDB, 0x7EEFCA76, 0x58B117C2, 0x0E7F33BE, 0x1C840B7A, 0x15EEE858
- };
-
-static const uint32_t in_key_s [4][256] = {{
- 0x4A0BABBD, 0x46B75CE1, 0xDA4E60D7, 0x62DD8F22, 0x668D7291, 0x70330C71,
- 0x8ECE2964, 0xD4D1D24F, 0x2247D3FF, 0x33BD2D83, 0x2A7DF912, 0xB9E711C8,
- 0x0E6544DB, 0x3A45B663, 0x8A9AB3DB, 0xD1A18732, 0x12700956, 0x25D9E559,
- 0x9A425C80, 0xCE51C1BD, 0x73D8583D, 0x22B93DE3, 0x3FF39FAF, 0x3B2E11F8,
- 0xA29731D0, 0x4F2C315F, 0xB46182CA, 0xB28C562E, 0xC37A96D9, 0x8AF05087,
- 0x745FB822, 0xEBC3F308, 0x2F40C980, 0xE16657A1, 0xBDECD15A, 0xC9948113,
- 0xD13F34A9, 0x526A159F, 0xF5982C49, 0x55E2220D, 0x0EAA7A36, 0x90771A3B,
- 0x852D659D, 0xF42B33CE, 0xBC55AB70, 0xD58495F9, 0xA01A146A, 0x146E0960,
- 0xDCC3EAFB, 0x45561BA0, 0x978C2955, 0x040E66A1, 0x54A12BDC, 0x86EB78C4,
- 0x317B7AB9, 0xC1131F78, 0xBC67C341, 0xF8850A30, 0x26EBAEB3, 0xA21BAB96,
- 0xF252C98A, 0xE8B913F2, 0x9237DBF2, 0xC549F051, 0xB37EBAEB, 0xE1BBC775,
- 0xC1655D75, 0x630A0946, 0xAEE49047, 0x4EC591BF, 0xB155B99A, 0x2EEC5B73,
- 0xDE713B06, 0x12A634B7, 0x13CE8AB7, 0x938D6C99, 0x3596EEE0, 0x500F9066,
- 0xF6F80717, 0x40D95E18, 0xC1D47A2E, 0x8DEE1E05, 0xE37E36A2, 0x54C7FFD3,
- 0x4AFFB9CF, 0x214CF5B8, 0xAB68B547, 0xB7CC1821, 0x5C7DA859, 0xB2DA7DDF,
- 0x846494FA, 0x8CB04D15, 0x1A4A71A2, 0x5FF08D8A, 0x8768DF65, 0x924E2FE3,
- 0x04B8109A, 0xE418742A, 0x58CD8113, 0x0EF7AAC9, 0x92B0CF79, 0xB01FBED2,
- 0x4DE3CE22, 0x6B779E20, 0x1CF126CF, 0x1789A794, 0xA8463DA6, 0xF3CCE7AC,
- 0xD225730A, 0x2D1B121E, 0x3F2C0850, 0xE327010B, 0x56D95881, 0x8639B3AE,
- 0x01B3CAEB, 0x1F6F9304, 0x7D4BF367, 0xE4EC20D9, 0x6D05AA51, 0x882B710D,
- 0xFC409837, 0x65E212C6, 0xA4C94A87, 0xB11A90AE, 0xB575256C, 0x9C12AF15,
- 0x682F72EA, 0xC4C8CE09, 0x43F6C164, 0x4BD015D9, 0x9B9B1FCE, 0x9C108425,
- 0x40A8DF10, 0xB0BC8633, 0x974EBB7A, 0xDE6FCE1C, 0xE005634D, 0x708C699E,
- 0x7D5BFC2F, 0xBC8D5BD0, 0xF0CCE026, 0xB5F50E04, 0x84124BC7, 0x9A34780C,
- 0x34E8E954, 0x64E165A3, 0x3007959D, 0x8DA44C08, 0xAA10D841, 0x7E876AE0,
- 0xB6020431, 0x47F4EA6A, 0xF4825054, 0x16C42BDB, 0xD1965562, 0x3777B610,
- 0x74B5741E, 0xD60C40D9, 0x3A5EF183, 0x8716250D, 0x91797C4D, 0x01A28965,
- 0xF9161DBC, 0x44A9E602, 0xABECEF05, 0xAA90BA96, 0x76607DBD, 0x48BF5BB9,
- 0x25840A8A, 0xD1AC56A6, 0x6F9B4274, 0xC56846D3, 0x88CF0D6B, 0x324EEFC0,
- 0xEA8304DF, 0xA27E4A81, 0x9AAB617B, 0x3301C499, 0x50E8FF17, 0x67B48F3F,
- 0x5AFB3B82, 0xF316F7D3, 0xBA425BB4, 0x083E12F4, 0x1CFAB3DB, 0x78C088A9,
- 0x6EC83605, 0xB46D30E9, 0x7A45D4FE, 0x1A31BAD8, 0x29242D72, 0x71EFF75F,
- 0x6DCFAC98, 0x79A1261A, 0x3865EEF5, 0x619461A3, 0xC25A0231, 0x750472D2,
- 0x7B714CBD, 0x7E57A0B8, 0xB3A7319F, 0x3FDDBEAB, 0xC4A71E85, 0x44D38329,
- 0xA21B0851, 0xBD44AE96, 0xFA3AF1D0, 0x3D6766B9, 0xA6884E85, 0xD3C9A0C0,
- 0xCAE680FC, 0x41C31A2C, 0x091EDF2D, 0x9EA4E645, 0x1CA034CC, 0xE10DBA18,
- 0x922AA9DC, 0x2DC318CB, 0xC49D6F10, 0xEEE7A768, 0x8173DD96, 0x96552598,
- 0xAB254BF2, 0xA5BFDEE8, 0x898E4896, 0x049DCDBA, 0x57BDCC74, 0x0F3399A4,
- 0x63909424, 0x6FEF1E46, 0x36A47384, 0x51F036DE, 0xAE707EA0, 0xDA83353C,
- 0xFB9E7298, 0xF9DCF17E, 0x4F6FEF42, 0x2A41B840, 0x7DCD2662, 0x381FEF90,
- 0x1773E656, 0xF6029EC1, 0xB1592A3B, 0x10A656D4, 0x6DDB2E61, 0x8E02EDFE,
- 0xE32782EA, 0x973D37F5, 0x1594C629, 0x8B73C632, 0x1680A138, 0x3F5B1228,
- 0x8C29E932, 0x49D384A2, 0x02794495, 0x118FF2E5
- }, {
- 0xAE22E435, 0xBF7344EB, 0xFBF3614E, 0xB52AF67A, 0x15EC7E8B, 0x0615CD74,
- 0x310931B6, 0x069D7297, 0x455368A0, 0xEEB001F7, 0x0E925151, 0xDEB13D62,
- 0x939071EE, 0x0BD2D2D2, 0x22AFF084, 0xF3D5BA75, 0xE8B78473, 0xE164B152,
- 0x8DD31804, 0x1AABFA34, 0xF1837C1B, 0xF50D14CB, 0x44F64DC6, 0x25C4CAC7,
- 0x59A2FE4B, 0x0C9E6026, 0x96A8908C, 0x49C0551E, 0x6C952FD7, 0x24BAEAA2,
- 0x6B9DC320, 0x727310AD, 0x09873DE7, 0xA815543B, 0x106743C6, 0xF4CDF032,
- 0xFB0208AF, 0xD58B37B0, 0xB8916BBB, 0xF31DC932, 0xB2273875, 0x94BFDD76,
- 0x2165879B, 0xA652B81E, 0x584698E4, 0xB42AF09E, 0x4DFF38F3, 0x29845BD7,
- 0x14F3B627, 0x5ECA5580, 0xFBDDDBB3, 0xD8392CB3, 0xF6B4FBE5, 0xFDCF2025,
- 0x31B61951, 0x9E588D9D, 0x25A07E35, 0xDCA8D140, 0x8C973391, 0x70C83894,
- 0x1B2F0DC5, 0x248E1EA0, 0x0760336A, 0x8F8BB40F, 0x0D1A660E, 0x0D1640F6,
- 0xA32B1F16, 0x3809890F, 0x82F7F0EA, 0x6CCC940F, 0xB9F2C42E, 0xB661A456,
- 0x5901ECB5, 0x76B92DF6, 0x21DB5718, 0xE23F3AED, 0xF94A8A63, 0x89F64664,
- 0x7335C780, 0x9FF900EB, 0xAC5D42D8, 0xF6049DC4, 0xB99BED2A, 0x3FE7D758,
- 0xDB69E89D, 0xCC9C3333, 0x382BB23F, 0xB07FB181, 0x9B20B744, 0x4E4ECE5D,
- 0xED8E3B98, 0x4AB66852, 0x78BCC661, 0xC1D8A28C, 0x71E08EB0, 0x9ECAE411,
- 0xA4FD636D, 0xA064969A, 0x185B05EC, 0x54896D93, 0x8110F40B, 0xD4D7E57C,
- 0x1E928C46, 0xF9CE1F29, 0x3E72FB51, 0xA79C044C, 0xADB9445E, 0x4AA394F9,
- 0x129534D2, 0xDF211944, 0x6267B4DA, 0xF534A6F8, 0xD45D2B3E, 0x5F1894E4,
- 0xCC27E376, 0xFE866D4F, 0x956E7C8E, 0x0A630CE7, 0x4734673B, 0xBF8AB871,
- 0x432C515F, 0xA2D7B37F, 0xCF48F9F8, 0x31F7209B, 0xB6E792D9, 0x5E136600,
- 0xF583A945, 0xAAD4705F, 0xE8E30373, 0xA5E5AB27, 0xCAC6FA4A, 0x48F3A109,
- 0xB21A697B, 0x45B9B7F0, 0x2E7BB193, 0x9603F1BB, 0xE0BA7A40, 0xCE7EB62E,
- 0x334B24C5, 0x0261817E, 0x4EB792AB, 0xB85BC2B6, 0x6D47D0D9, 0xD2A1433B,
- 0x7523942B, 0x39BF5CE7, 0x72223B25, 0xC28F0913, 0xC01CFE44, 0x500F27E5,
- 0x055379CB, 0x786C7B08, 0x7C75295A, 0x6294932D, 0xF1B01EF0, 0xE79358F6,
- 0x89C4E49F, 0xE7F73D07, 0xEF6FE437, 0xF2CDA93F, 0xB0994E68, 0xADF6AC19,
- 0x00925578, 0x06454AF8, 0xCE4628AB, 0x9F983E8C, 0x393E59A4, 0x3896C188,
- 0x6A0A5EF5, 0xBA378BF3, 0xD27590ED, 0xCFD20FF9, 0x1728237A, 0x8DABD973,
- 0xE22C9842, 0x29A1264B, 0xFFC8569C, 0x17DDEBAA, 0xF9D62958, 0x11028197,
- 0xC42BD84F, 0x6F81854B, 0x061FD297, 0xD26BA792, 0x63F71BAA, 0xAD36BDCC,
- 0x06262269, 0x5711A1F5, 0xAA746143, 0x75242F8D, 0x5817A84D, 0x639ED1B6,
- 0x6D18D6C4, 0x4FFEFE01, 0x0689F6D4, 0x5997D712, 0xD761CF5B, 0x9211216C,
- 0x5D8006F3, 0xDDE24FEA, 0x1E60F66B, 0x18D41ABC, 0xDC72B4CB, 0x9FBCBA7D,
- 0xEAA807C5, 0x700B7E32, 0xCF4173D6, 0xE354A49E, 0x12EB5466, 0x63DCC4E4,
- 0x1DC24D6E, 0x1C9F2A83, 0x3DF6F311, 0xFFA91651, 0x3A1A9645, 0x30D568A4,
- 0xC51A55B4, 0xEE032227, 0x0F0A28AC, 0x4516C9B2, 0xD7323F98, 0x547C3B78,
- 0x5BCA33E1, 0xF28A15C2, 0xDFFEFAAD, 0xD6E87BBD, 0xE820C21D, 0xFB1C97C3,
- 0xE40869F7, 0xD4A167F0, 0x79A2EFFC, 0xD67A0D93, 0xE862FF06, 0x54BCFB17,
- 0x3420A670, 0x9219126B, 0x54930637, 0x55E84ED3, 0xA8C4D3C6, 0xFC2C2BD2,
- 0x73B116F0, 0xE7A2900C, 0x801E1978, 0xC6741B16, 0xFADB0E61, 0xB5315FC8,
- 0x76D1E2BD, 0x2C3452EB, 0x9F42E977, 0xBBE3B7FF, 0x3E5A0B7F, 0x4E1E865A,
- 0x24D40A06, 0x202F6EDB, 0x9BAEBAFA, 0x6272D57D
- }, {
- 0x72B35463, 0xF3AD17A4, 0x5631E69E, 0x407BBD75, 0x3508A084, 0x88AAF1CE,
- 0x4B04905F, 0x2F2FEBE0, 0x09AA8992, 0xDE1EA57A, 0x1FDBFAFD, 0x3827C109,
- 0x764DFD38, 0x5C4A2FB0, 0xA1E90138, 0xF4814033, 0xD086FC2A, 0xB388B360,
- 0xFEA5D332, 0x47202A75, 0xCD25CB9A, 0xA351B744, 0xB7F4A6B6, 0xEE1658C0,
- 0x5016807B, 0x12574F7A, 0xB517B43C, 0x741262F5, 0x6F00F349, 0xDAA44579,
- 0xE58B8090, 0x6FC04F54, 0x8451D14A, 0x84C352B4, 0x710C2858, 0x0FE8F84C,
- 0xAF5E81F8, 0x0865497B, 0x552638F9, 0x3109EBED, 0x13C29D74, 0x276CB543,
- 0x8CA65E96, 0xE983C198, 0xB85CDC58, 0xB522FBCD, 0x21506FF9, 0x8C703690,
- 0x322A3026, 0xB87B9BA5, 0x49FF5C4F, 0x3B3E927D, 0xCC9E8227, 0x064CEA69,
- 0x88F21343, 0x4EDCB6EC, 0x0F7DA6B8, 0x2ABCEF9C, 0x86866163, 0xBF4B1B4F,
- 0x94E0E0E7, 0x8CFE5DF6, 0x4A8D073B, 0x43916370, 0xBCED0841, 0x2D8EF63A,
- 0xFEFC6AE8, 0x7A3284CD, 0x51FAE69D, 0x34996231, 0x15599997, 0x5A8D2DF2,
- 0xDC8F5265, 0x2B23915D, 0xAC578846, 0x0B9BC885, 0xE5AEF368, 0xE352A2EB,
- 0x67330720, 0xFD176A18, 0x78BB578F, 0xB5422A51, 0x68F35707, 0x47570020,
- 0x8A4F5321, 0xB6774AB5, 0x06CE136C, 0xADED4447, 0xAE8A1FEE, 0xB97BAB2D,
- 0x95B81706, 0x493E002C, 0x0D9DC930, 0xF70BF46D, 0x229C90F8, 0xAF450341,
- 0x12B799C0, 0x98656508, 0x8C8D6417, 0x491D1ED4, 0x1AF33256, 0xF3275DE1,
- 0x08454958, 0x321A8D4E, 0x4F516FE5, 0x1D076087, 0x94311B59, 0xED369CB9,
- 0x4FF94F65, 0x87129FB4, 0x8D065220, 0x7B11F2D5, 0x976138B0, 0x030962FB,
- 0x8E68ED5F, 0xE26B5272, 0x045BCBEB, 0x9350F121, 0x522DDFEB, 0x1EEB70B2,
- 0xCC2EABF8, 0x22BA4ED7, 0x30B0C3BC, 0x64DF8A4C, 0xF58B3FF2, 0x56B3BBE6,
- 0x3E71A700, 0x65D765C7, 0x87A50635, 0x9156084B, 0x85CD7CAA, 0x7BFF8FFF,
- 0x7B79A939, 0x69277DCA, 0x5A7C5DF2, 0x37886A35, 0x177CA1B3, 0x96871FD4,
- 0xB869BA3D, 0x1C2697A1, 0xD59109DD, 0x6B870F45, 0xC9ADBA95, 0xDB8323D8,
- 0x0A777311, 0x25E2DF2D, 0x18C684D7, 0x645521B0, 0x58ABD6FC, 0x7EC9EF2D,
- 0x11B4DB17, 0xAE1A2EE9, 0x84E961A4, 0x1627F703, 0x8C23EC6D, 0xF0A8A31C,
- 0x8E53A703, 0xB1131710, 0x5723CF12, 0x991DF0FF, 0xA30498B8, 0x02EF0D79,
- 0x2B3DD3EF, 0xD38C2931, 0xE5745386, 0xF41AE34F, 0x10499E3C, 0xF79569CE,
- 0x8ED71CA2, 0x98B0DC30, 0x9F6E5321, 0x42EB67BA, 0x2742BCEC, 0x8DF9EF50,
- 0xAAA09BA7, 0xF9695506, 0xA294E5EF, 0xDC12C945, 0x0F7A7CEA, 0x9E19DD96,
- 0xABD27434, 0xD26E3C3F, 0x13B45FF0, 0xCF8379E7, 0xF85FF493, 0x985079D6,
- 0xBDB81502, 0xA2C60C5C, 0x22B632AC, 0x3D3986EE, 0x45825465, 0xAEEB58F9,
- 0xF283D84B, 0x80517003, 0x942B1C72, 0xE3E70F85, 0x3F8E843D, 0x7454E06D,
- 0x31B2159B, 0x568A8365, 0x23DCC43E, 0x37871B58, 0x60C69863, 0xD1889242,
- 0x520946C2, 0x929B3286, 0xD95FED2C, 0x2A208340, 0x928DF232, 0xC028DF59,
- 0x0D35A23F, 0x00EDC91C, 0x3979AED9, 0xAA29C007, 0x84BA7B37, 0x7E3CA9CB,
- 0x54F00B03, 0x61691F7C, 0x5834387D, 0x770BB788, 0xB162F9C0, 0x43618701,
- 0x9E059974, 0x06E5F826, 0x0CF7163D, 0xBBE0FE4D, 0x7F106BA3, 0x71A5CDA3,
- 0x7044BD36, 0x54DB9C6D, 0xCEB6C2E7, 0x4DE29FAE, 0x136CB930, 0xEA408A55,
- 0x7ADB6970, 0xC89057DA, 0x70B27C55, 0xFD9DD49F, 0x71945289, 0x29F6F8CA,
- 0xDFD414FF, 0x3A073C7A, 0x610CB803, 0xF63DB2F3, 0xDAB51606, 0x1D98C2CB,
- 0x8EAED1E3, 0x2713BE03, 0xA7740897, 0x4184FD27, 0xF4FB8A06, 0x42B5EE24,
- 0x16CC60A1, 0x58C7FA50, 0x0D3A4CB4, 0x40C16EFA
- }, {
- 0xF0B6672A, 0x2FBFF845, 0xF8DAE2E1, 0x1E62ADD9, 0xE386B139, 0xCE326446,
- 0x1F85E0A2, 0x876AC684, 0xF89F69ED, 0xB9C1F96B, 0x0F350297, 0x5D5C5727,
- 0xE4D11EDE, 0xCB7964CC, 0xE1646E44, 0x413DB994, 0x50169691, 0x2A75843F,
- 0xE56CE654, 0x307C49E8, 0xABBF759E, 0x18E30B64, 0x1DBD8903, 0xED9C2D59,
- 0x2DDFF02B, 0x6EF2C41D, 0x3FF08CED, 0x5C4B7F31, 0xB26984CA, 0xB0B1EFEA,
- 0x9C11734E, 0x680B8B66, 0xDC671C46, 0x2F8DD9C2, 0xCACF3975, 0xC3F6D8DB,
- 0x38DDF820, 0x421E0652, 0x9FBE5AFA, 0xB4F43AE3, 0x957FC205, 0xFFA58375,
- 0x55286205, 0x7EE974B5, 0x31DECAF4, 0x3E7425ED, 0xACD2BC1B, 0xFBB39E17,
- 0xE99CE668, 0xC3DE689F, 0xE8BC3A39, 0xC327F086, 0xB3F2E894, 0x13CDC849,
- 0xA7D8DACF, 0x2987F368, 0x7FC52A15, 0x2C0DE867, 0xC39020AE, 0x6B9A5BEB,
- 0x1116EB0C, 0x56FAD5FD, 0xE13E5C39, 0x167F6C42, 0x1462F7F4, 0x5D1875F4,
- 0x82A56F78, 0x2DFB88E6, 0xD0191186, 0x0850D44A, 0xCEFA0FC4, 0x3FB97E0B,
- 0x3225B980, 0x3D33D41F, 0x595FA8D5, 0x3FB1945B, 0x94D5E9FA, 0xDDEF2BCB,
- 0x4C35A2D9, 0xCF328015, 0x7DEEB93C, 0xF76A0735, 0x6CBE97D8, 0xE1E32FD2,
- 0x72537C1C, 0x6946111C, 0x689A0958, 0x2A82EBAD, 0x5A70B4F6, 0xCA2C98CF,
- 0x500B4CB5, 0xE4F72532, 0x317ABF2E, 0x9B16512E, 0x612F8F0B, 0xBF323BE6,
- 0x7A9A4827, 0xE401B548, 0x4776626E, 0xCB602107, 0xEC189B17, 0x94A36CB9,
- 0x00C86686, 0xDA12464F, 0x0172E4EC, 0x9779E7E2, 0x45349B40, 0x7286BCE1,
- 0x1913C435, 0x8BF1E440, 0x16BB54D3, 0xE700E633, 0xF524785A, 0xB27F3F09,
- 0x25B6406D, 0xA19BF68C, 0x3B144DA2, 0x816B70C0, 0xFF86B5D6, 0x1E75EBB3,
- 0x57B4F242, 0x46771F2A, 0x53776C5F, 0x6257CECD, 0x27D7A26B, 0x74AD749F,
- 0x0E8DF172, 0xFA7C4A26, 0x8F978578, 0xF3265767, 0xA08160FB, 0x8A13431D,
- 0x22213265, 0x4A018EF2, 0x526BB8F8, 0x5FC7F38C, 0xFAB62CD2, 0x50EF8674,
- 0x3E4FC6E1, 0x08553D35, 0x2BCC6BD6, 0x06D22116, 0x25F16EE8, 0xB51D172B,
- 0x8E657082, 0xD102410A, 0x6B8DE05D, 0x22AEA76E, 0x0B692D8D, 0xC5E7C0F1,
- 0xB3499478, 0xAB3AE1FF, 0xC16DCFB5, 0xB5F67469, 0x31C015AE, 0x7807E2FF,
- 0x67E17C48, 0x56BB3693, 0xB11ABE01, 0x4AC2383A, 0x54D6BFDF, 0xBA1F540E,
- 0xF4CEFE7B, 0x7F9CD102, 0x82C1AB14, 0x4D32978E, 0xE3832FE2, 0x1E63A9AA,
- 0xCB1BB7CB, 0x478E6C6D, 0xD8C0CB68, 0xB907DA30, 0x05BC439C, 0x79872F07,
- 0x74040F93, 0x5EE6EABD, 0xC700C640, 0xE2740CF2, 0x7D9611A6, 0x28C34433,
- 0x9519AF00, 0xACAE30BA, 0xD1ED6770, 0x72557C82, 0x50D9BCCD, 0xBCDEE88E,
- 0x97E36EFF, 0xCC382EF8, 0x71B71FC2, 0x6EED0311, 0x17B065C2, 0x38BE59A6,
- 0x6D47222A, 0x9940BBDD, 0x342463F0, 0x98723D62, 0x59EC6C09, 0x13E077BB,
- 0x6CDD2887, 0x763D4A95, 0x51D7A260, 0x7615C8BF, 0x7BAA1B0D, 0x85E2F0B8,
- 0x29A14FB7, 0x90BC2A4F, 0x15A17CE1, 0x95BBC7DA, 0x98384B5B, 0x964E6B18,
- 0x1341FD22, 0x64BC571D, 0x856E353D, 0x92846808, 0xBDBC4F81, 0x11C5A93F,
- 0x9B00D8AB, 0xE9C7F68C, 0x002C42BE, 0x79B7F2E8, 0xCC450F36, 0x106D1921,
- 0x8306ECBF, 0xB3E092E3, 0xFB4A2813, 0xC46D7B9F, 0x7CF4F348, 0x1BEB4962,
- 0xFEC844F2, 0xD5FE7D0A, 0xF28A1872, 0xA0E433FE, 0x5EDB808D, 0x01591BE1,
- 0xDB4E08F3, 0x298A0DFB, 0xC638BB36, 0x59F96184, 0xA344CD21, 0x39BAFAD3,
- 0x83112A1C, 0x1892FC88, 0x856E9D5C, 0x13FD4F16, 0x81802AB7, 0x79FB698E,
- 0xAB8AF3E1, 0x986C72C1, 0xF1565939, 0x332EFF7D, 0xD0D7746C, 0xDCF7CA0E,
- 0x61E6931A, 0xF582D866, 0x2C3410D9, 0x21D70463
- }};
-
-#endif /* _CRYPT_KEY_INPUT_H */
View
217 src/libpiano/crypt_key_output.h
@@ -1,217 +0,0 @@
-/*
-Copyright (c) 2008-2010
- Lars-Dominik Braun <lars@6xq.net>
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
-*/
-
-/* encryption key for xmlrpc */
-
-#ifndef _CRYPT_KEY_OUTPUT_H
-#define _CRYPT_KEY_OUTPUT_H
-
-#include <stdint.h>
-
-const unsigned int out_key_n = 16;
-
-static const uint32_t out_key_p[16 + 2] = {
- 0xD8A1A847, 0xBCDA04F4, 0x54684D7B, 0xCDFD2D53, 0xADAD96BA, 0x83F7C7D2,
- 0x97A48912, 0xA9D594AD, 0x6B4F3733, 0x0657C13E, 0xFCAE0687, 0x700858E4,
- 0x34601911, 0x2A9DC589, 0xE3D08D11, 0x29B2D6AB, 0xC9657084, 0xFB5B9AF0
- };
-
-static const uint32_t out_key_s[4][256] = {{
- 0x4EE44D9D, 0xCCEEAB0F, 0xD86488F6, 0x25FDD9B7, 0xB0DE3A97, 0x66EADF2F,
- 0xC0D3DCA4, 0xEE72A5FA, 0x54074DEC, 0xCBAD83AD, 0x4B1771A3, 0xD92AE545,
- 0xB5FCE937, 0x26AD96D9, 0x5D615D68, 0xF2994B82, 0xE668D342, 0x61051D4C,
- 0xCFB29CA4, 0x8B421D38, 0xDA3B4EB9, 0xD92D6A55, 0xF7D940C7, 0x99C4BC83,
- 0xAB896E79, 0x77C7039B, 0x1215B24A, 0x0C0EBC0D, 0xE9F082B2, 0x6B7DFE9C,
- 0x4A714E76, 0x91280D88, 0xA422A361, 0x3E674D4A, 0x6EBC2D42, 0x6838580B,
- 0xBAE461AB, 0xE8FEDD17, 0xEFD6E5E0, 0x690D3E93, 0x32FADEB0, 0x1B99EE04,
- 0xBE9FA7D9, 0x7997DFC6, 0xFD1B8025, 0x667B35D8, 0x2D909996, 0xFE487FF0,
- 0x628BCFE1, 0xA534C620, 0x6644DEFE, 0x8BF9236D, 0xE943DD51, 0xF4615657,
- 0x605D4F80, 0x2E02FC45, 0xD924D2D0, 0xFD4AB9E3, 0x5AEB18F0, 0x7A8D7C92,
- 0x6CA40CA6, 0xD8AD4139, 0xCA5E7EC2, 0x69BE3C59, 0x554A4DD6, 0xBA474DD1,
- 0xE113576B, 0xCB89A6BD, 0xF366EC0C, 0x876661AB, 0xD85E5381, 0x79A93327,
- 0x5A4E5D92, 0xE3301F23, 0xF211DD61, 0x6F0140D0, 0xDBA134BF, 0x3C623008,
- 0xD5FCE976, 0x6EDE648E, 0x814CF920, 0xB38878E1, 0x6232D49C, 0x2310373B,
- 0xA8C6EBFC, 0xCD506842, 0x62BEF441, 0x1324C803, 0x69D1F137, 0x3907EE67,
- 0x47967932, 0xC3C3F280, 0xC4B036B9, 0x5EC264B4, 0x9484AA3C, 0x5FEF9C53,
- 0xC1B9030F, 0xE86C6BBA, 0x3AE49DAE, 0xBBAC421C, 0x54D06D99, 0xBA13A2B2,
- 0x3132FA87, 0x2FDDB5E2, 0x4B751219, 0x5B59778F, 0xEFFA2E62, 0x3BD56164,
- 0xE7EDFC1D, 0xCF4D5FDB, 0xC6310BDA, 0x0CAE8B8F, 0x53196C2F, 0xAC951D1F,
- 0x32FD1D71, 0x7D9D5956, 0x2EA62C92, 0x9FA4A4C8, 0xE491DC41, 0x7E5F2507,
- 0x4568300F, 0xF210AAA8, 0xB6980949, 0x017405E7, 0x5EBF3350, 0x44B863F6,
- 0xDF96854A, 0xFA8A8390, 0x342BDFFA, 0x93096350, 0xCD0F0083, 0xBE295FDD,
- 0x549AA9C9, 0x8554D31B, 0x2F2FE138, 0x30E8C78D, 0xED603733, 0x4B47F4C2,
- 0x03D481DC, 0x8BE4479C, 0x9A307E98, 0x73CFC5DC, 0x71DE3DFB, 0x55DA2605,
- 0x2CC97898, 0x13F0CC6F, 0x5F30FEE1, 0xF65D36D0, 0x99D05438, 0xB6A1DF23,
- 0x2EA6EF9B, 0x12D3A110, 0xF1C89B1A, 0x522BAA1F, 0xE39AC7B3, 0xAFC153D1,
- 0x2A565274, 0x51530B46, 0x1291387D, 0x15BC2B63, 0xA73AD01F, 0x13EBC4A7,
- 0x849583D7, 0x4A9E1AE6, 0x430C9A05, 0xEB2A78FB, 0xFA3A817D, 0x6D1D7AE5,
- 0xB99588F5, 0x6D2C571B, 0xF975441C, 0x1348927D, 0xB069BDE2, 0x0771A398,
- 0x4B93EDCC, 0x3C167223, 0xC3BBCFDF, 0x40C406DA, 0x81C867B1, 0xEB20C3D2,
- 0x2476ED54, 0xB581F042, 0x1160A8B8, 0xBCA1AD0F, 0xD8F18C9F, 0x708BC7C6,
- 0x0579D83C, 0x29BAA2B8, 0x45B845EE, 0xA57F5579, 0xE52E4A8A, 0x48365478,
- 0xC6CCBFB4, 0x2F53D280, 0x8E1FF972, 0xF4E02067, 0x3F878869, 0x5879FF3C,
- 0x1EDFAB0F, 0xD4FE52E3, 0x630AC960, 0xABD69092, 0xFAA3BF43, 0xF1CA3317,
- 0x9CFF48D2, 0x8FE33F83, 0x260C1DE3, 0x89DB0B0B, 0xF127E1E3, 0x7DA503FF,
- 0x01C9A821, 0x30573A67, 0x8A567A2E, 0xE47B86CF, 0xB8709ADE, 0xB19ADD3A,
- 0x46A37074, 0x134CE184, 0x1F73191B, 0xE22B39F6, 0xE9D35D3D, 0x996390AF,
- 0xADBBCCDB, 0xC9312071, 0xD442107D, 0x0B50C70A, 0xB9B6CC8C, 0x60A51E0E,
- 0xA1076443, 0x215F1292, 0x5A53C644, 0xEA96EA2E, 0xE9F3B4BC, 0xBA5F45D2,
- 0x454B65D6, 0x2CF04D9C, 0x05EF1D0F, 0xCD1ABBEE, 0xE86697B0, 0xFB92F164,
- 0xEBEDADBF, 0x69282B8D, 0x65C91F0D, 0x6215AB51, 0x87E7BDF6, 0xC663D502,
- 0x6EF4864E, 0xDC3BDCC9, 0x97184DBB, 0xCD315EED, 0x64001E09, 0x6F7DE8CE,
- 0x38435D03, 0x840B5C82, 0x23CDBC8A, 0x7FA0D4FB
- }, {
- 0xEBCBE20D, 0x09FADAEC, 0x98FF9F63, 0x16D0DFE1, 0x54B65FA8, 0x8C58D07C,
- 0xEAACBEA0, 0xEA8BC5B7, 0xD343B8ED, 0x46D416FC, 0x0247DCBB, 0x527CA3F5,
- 0x22DAF183, 0x6684CF7F, 0xA2D5D9F6, 0xC507E43B, 0x7B368AE6, 0xFC8179EC,
- 0x47E959C4, 0xDADF15F2, 0x92E48145, 0xD9CFA8B3, 0x94F209E8, 0x10F93D6D,
- 0x3BAAF7B5, 0x9E5009B4, 0xE7E66FD8, 0x10F6D58F, 0x1EAFFF4D, 0x0423FCE5,
- 0xE860C60A, 0x7713B2B4, 0x7C5EEF7E, 0x430801CF, 0x46613A77, 0xFADEC916,
- 0x58AB09B3, 0xEE05C51F, 0xD4C6331F, 0x9BCA1941, 0x15BF041F, 0xC3B04E8D,
- 0x6CD037AF, 0x11C81E53, 0xB38393DF, 0xB1D07B52, 0x067D02F7, 0xA9E5798B,
- 0x4E5C10A6, 0x790DD862, 0xDEA21AD1, 0x3C0C90BF, 0xB05D8240, 0xFEA81F59,
- 0x832F19FF, 0x17190D1C, 0x03E07FDC, 0x43A6AEAC, 0xFE0C8A2E, 0x216813A6,
- 0xF0428728, 0xC1D21DCF, 0x54109ACB, 0x68FB51BB, 0x3F5AEE69, 0x557FEA14,
- 0x07965E16, 0x58E2A204, 0x6E765B0C, 0x3B8D920F, 0xDD712180, 0xDD0F67CA,
- 0x37F9D475, 0x91815CCF, 0xC31A34BB, 0x8F710EF2, 0xF2DA2F82, 0x2A24931B,
- 0x41CFF29F, 0x16C9BECF, 0x1AEB93FB, 0x090DF533, 0xC10D27B6, 0xF7EE2303,
- 0xF82A0ED0, 0x57031132, 0x88AFF451, 0x574A8BFF, 0xF1ACA4F0, 0xDD556F49,
- 0x90D7CF52, 0x4BCA4AA3, 0xC917557C, 0x4BB6B151, 0x52CD8251, 0x7C7ED836,
- 0x3488ED59, 0xC50C6A0B, 0x675413ED, 0x6368583D, 0x98B61BAE, 0x1AF59261,
- 0x46590022, 0xA4C70187, 0x4658F3EB, 0x80A61049, 0x8F120E7A, 0xBEAC09D8,
- 0x195ACD49, 0x6BE1DE45, 0x6EF1E32D, 0xB8A4B816, 0xC18758B8, 0xCA7AD046,
- 0xD475BFE1, 0xCC3AB8AF, 0x45AB9AD7, 0xC37C62AC, 0x9AAD7E2E, 0xB9D87862,
- 0x28F3CD26, 0xA0577A0E, 0x75859ECE, 0x4A6E5B86, 0xE61E36B3, 0xA00E0CA4,
- 0x3E2CC99C, 0x581DF442, 0xCE40B79B, 0x17BAB635, 0x73F1C282, 0x7C009CE0,
- 0x1A8BBC5A, 0xBBB87ECD, 0x162ED0AC, 0x8DB76F5A, 0xD5AD1234, 0xD0D7A773,
- 0x41CBDEFB, 0x7197AFF4, 0x5C60E777, 0x5D9141D4, 0xF43D5211, 0xA4F064D9,
- 0x40C13CB3, 0xE9DE900D, 0xBF733203, 0xC00F2E89, 0x095D476F, 0x277A825D,
- 0x4B6A61D3, 0xFF857740, 0xE34705C0, 0x65F8372C, 0x497AC161, 0x1231CA4A,
- 0xFB385036, 0x24B36150, 0x6CB9FA2D, 0xCBAB3399, 0x3832629E, 0x1BB815EE,
- 0x6AAA74C7, 0x8FFA22B8, 0x64093F28, 0x973BBA95, 0x831A8195, 0x48B2923D,
- 0x9680C36E, 0x16BA5344, 0x1F190542, 0xBCB0DFCC, 0xCCC24623, 0xFA503EAD,
- 0x7189956C, 0x80B3C715, 0xFA9F4685, 0x36CF833E, 0x19A53ADF, 0xA5A4BD79,
- 0x187ADC8D, 0x8AEFA6B6, 0xF64FF62A, 0x88A590BA, 0xE30C75BE, 0xA3BFBCC7,
- 0xAC669722, 0xC4AEAFF2, 0x822DC5FA, 0xAA73C1D5, 0x422EFD93, 0x946FE915,
- 0xEF623E46, 0x24395A31, 0xF28FF488, 0xB4D7CA7E, 0x27703504, 0x9F390B73,
- 0xA6999558, 0x8AE04A20, 0xDD6FE7DB, 0x55963137, 0xCFEF70BB, 0x708CA677,
- 0x804CF78B, 0xD5AC1CA2, 0x88D7CCFC, 0x5FE056DF, 0x25B390EA, 0x11550845,
- 0x15A58C0B, 0x7C3530A3, 0x24550544, 0xD395EDD0, 0xEB046782, 0x7E3CCE71,
- 0x25A8640C, 0x96A955DE, 0x4BF7614E, 0x3014FD08, 0xE2AC1E2E, 0x7D3AB3C3,
- 0xB63CB59C, 0x9E92D401, 0x859B2C44, 0x1F893940, 0xEE81B9BB, 0x7F430589,
- 0xAF2CC2EC, 0x0FA273E2, 0x3E5C6FAA, 0xE580E6A9, 0x64D73FE6, 0xE7C5A28A,
- 0x99B760BC, 0xC0FCBA71, 0xDB521C76, 0xDBC7C1F8, 0x4968CF63, 0xD4928D17,
- 0x6DBBCC5F, 0x681EB668, 0xC326CEB9, 0x7C6B0EBB, 0xF071C193, 0x5CC6A08C,
- 0xFA4B95EB, 0x0BED345D, 0x16854F61, 0x22ECDDA9, 0x77335F2D, 0xCC016EE5,
- 0x4CE1D7F6, 0x32B1409B, 0x2197B046, 0x73CD94F3
- }, {
- 0x56D997EE, 0x92FA3097, 0xA1AF0D9D, 0x11FCBB9C, 0xA2673993, 0x3860F1CE,
- 0xB2B70A39, 0x5BC90183, 0xBFA62ADC, 0x58E257F2, 0xD221A704, 0x0A876CE4,
- 0xD7B0FCA9, 0x80D3D874, 0x696A6CFD, 0xB989EFF1, 0xEAA5F132, 0xA29ECB5D,
- 0x674B7380, 0x0BAD725F, 0x59D55508, 0x8DB40E2A, 0x003EBD12, 0x871AD00E,
- 0x7ACE20A9, 0xE670BA85, 0x43D53997, 0x79461049, 0x806C102B, 0xB21337BD,
- 0x791483E8, 0x6ECA44EA, 0x959CF50D, 0x8D87166D, 0xFA939DF8, 0xB0E519DE,
- 0x8C069B44, 0x0A47F71A, 0x8D7AD1CA, 0x24E6FEDD, 0xCEF2173E, 0xB46A57F1,
- 0x9DD9C775, 0x549B2E5D, 0x67A37485, 0x38F7FC18, 0xA269F5A1, 0x1B04F14E,
- 0x4550E006, 0x8F5E0E14, 0x5EB9992C, 0x88D780A5, 0x334FFA1E, 0x473A75C1,
- 0x9D96E913, 0x7DB16188, 0xE699B708, 0x88D087FA, 0x06E44D4E, 0xCB29E519,
- 0x68529AB8, 0xBC74B1FD, 0xDA074140, 0x557B9936, 0x80BB557E, 0x42522D24,
- 0x909E967F, 0x7D578A28, 0x7F78EBD7, 0xB793DC4B, 0x08498F07, 0x8A77FC08,
- 0xFFFDA0C1, 0x2ECA4123, 0xB63861DC, 0xD909606E, 0x29A545E4, 0xB37539D6,
- 0x292FAC93, 0xBDC6C4F3, 0xDAC7CE05, 0x68201C9D, 0xE08DC67A, 0xE0FB0327,
- 0x17554D62, 0x636D9040, 0x0612D29F, 0xAF250475, 0xB8961740, 0xBE3E4408,
- 0x3AF166E6, 0x3B16CC87, 0x2DC77141, 0x3C874024, 0x0E409623, 0xC7576B7A,
- 0x35CAF7DA, 0x0AA9AED6, 0x6C5F2CC0, 0x23AAB90F, 0x74A41C51, 0xDAA1B557,
- 0x412EC422, 0xD9E55CF0, 0x7F6A804E, 0x9256A133, 0xF3FD2639, 0x42C9A68A,
- 0xB20588E4, 0x33339C04, 0xCB9B9300, 0xCCA198E9, 0x849A2FFF, 0xF2B71118,
- 0xD27C41DF, 0xF1453CD9, 0xEB94D640, 0x9CE6A69E, 0x1561C1BD, 0x8A8F7E07,
- 0x1FA3989C, 0x601C3440, 0x95DE5ED8, 0xB2F2AE94, 0x831BA7C3, 0x6831E3ED,
- 0x5C5C0BD8, 0x628A0E89, 0x2726D7A3, 0x82B6E434, 0xB729A5C7, 0x5AB563C2,
- 0xA4119CE6, 0x4459E404, 0x0B3E858A, 0x080C2DF9, 0x6EBE3FFB, 0xC1D64BCE,
- 0xB2C90336, 0x998AE507, 0xC152879A, 0x31B99F23, 0x37769978, 0xF5C78668,
- 0x2B954114, 0x54169F1A, 0xBF9E6E7D, 0x41BEBC39, 0x35BC63BD, 0x77E91F12,
- 0x89909690, 0xCB17B79D, 0xCCBF4A25, 0x3E5E653E, 0x3B4531F1, 0x31AF6109,
- 0x027DC03F, 0x334AE2A7, 0x8A685A70, 0xD82C335D, 0x7D73C193, 0xF0311C79,
- 0xE8091EAF, 0x64B12983, 0x85CEB9A6, 0x402AB7C9, 0xA95E4546, 0x85CE4FD7,
- 0x21968004, 0x0846E117, 0xD290B888, 0xCE2888FC, 0xE2F318F1, 0x89B189DD,
- 0x7A2D73BA, 0xE28937E5, 0x6D857435, 0x8A2F05FA, 0xA19B966F, 0x37EF297F,
- 0xC50696F5, 0xA7C3DE1A, 0x988D3850, 0x24007793, 0xB94C792C, 0x4DA98736,
- 0xA04EB570, 0x4AA44F84, 0x7124E7C6, 0x13B9026E, 0x27AC2D15, 0xFBB9AD93,
- 0x2F94AA1C, 0x98587A3D, 0x9C9DB996, 0x7E3487D5, 0xA819272C, 0x32AA5E43,
- 0xE0DB72F5, 0x4DB4853C, 0x7350C7EC, 0xB1626C73, 0x07130A5F, 0xC3DAA529,
- 0xD6422735, 0x8559200D, 0x1046E85C, 0x326CFB54, 0xAD42DB6A, 0xAE4CC364,
- 0xA49F5718, 0xF472F8A0, 0x3C002484, 0x013067BE, 0xC88A1317, 0x4C3C209B,
- 0x7CBB8BB3, 0x41FB8DAF, 0x236591B3, 0xDC974A45, 0x8639E738, 0x97C38B19,
- 0xD7FF5725, 0xE7094458, 0xF28B223F, 0xF73C878B, 0x7F7502D9, 0x52F7FD09,
- 0x4A661B36, 0x62814D8E, 0xBBDD1D16, 0x002598D9, 0x56B17A84, 0x87A331B7,
- 0x6C2898C2, 0xAFCBA795, 0x4EFEE9AE, 0xEAE3A4F1, 0xC3D4D9CD, 0x5EFD7C32,
- 0xB1B31E64, 0x95245686, 0x21A7DA12, 0x7155E041, 0x7362B475, 0x36486BD5,
- 0xA97E5D7C, 0x8871303B, 0x93199D52, 0x246F919E, 0x5A581359, 0x6AE746DD,
- 0x3CA9098C, 0x56DA5714, 0xAA0B674A, 0x08C89A5D
- }, {
- 0x7DD47329, 0xF270A704, 0x71BF31DA, 0x3B57772E, 0xFBE90F4B, 0x87FC23F6,
- 0xCF413D71, 0x4FFEA8EC, 0xEFBA20C2, 0xEB53E0C1, 0xFFE7633E, 0x854E28E8,
- 0xFBFFE904, 0x8A7841BE, 0x94E99960, 0xA3E69064, 0x365C57AB, 0xBEE976CC,
- 0x596B94C2, 0x8C5E90E2, 0x074B3C54, 0x89B5E926, 0xDF192C71, 0xAF631D85,
- 0x67A8EDEC, 0x24BE4919, 0x81EB9C8A, 0xFDB13471, 0xEE61A4A1, 0x1EE368DE,
- 0x8C55C255, 0xD273A000, 0x12A24DCD, 0x22A6708E, 0x6BB4C19A, 0xF2599FDE,
- 0xE84B8A95, 0xDD578159, 0x1F666F1E, 0x483BBCE2, 0x46E340BA, 0x8B7D6490,
- 0xE65BD77D, 0xA50F2282, 0x4B455D23, 0x9B5D486B, 0x95CEA1A3, 0x4B7A484A,
- 0x2E16BE82, 0x096A8E05, 0x5494AF5E, 0x1EBA1525, 0x84FDB773, 0xD47CE143,
- 0xC1254007, 0x1CE4CBBE, 0x8049402D, 0x114D7B59, 0x64D760AD, 0x6AEECE49,
- 0x83DC9867, 0x36FF9C28, 0x6FFB709D, 0xB22F7301, 0x6E6CAD92, 0x0001F394,
- 0xB560CDE7, 0xEA02FDDA, 0x40609266, 0x7F599B81, 0x1B8FD59A, 0xA562FF5C,
- 0xA01750C6, 0x78A35114, 0x789F8094, 0xF46594B8, 0xFF3A12BE, 0x29DDEB50,
- 0xE3CF5A2C, 0x8E440B20, 0xBFBF3DD8, 0x649DB58A, 0xC48A8A51, 0x97F139C3,
- 0x0BB07943, 0x548C90BD, 0x8153FCF1, 0x13098DEF, 0x812EA492, 0xFC0AC487,
- 0xC5EAE50A, 0x7A02481B, 0xC75279D7, 0x59CBC149, 0x6AB39416, 0x39331E1A,
- 0x233BE50B, 0x7F09C1BD, 0xECC11E6E, 0xA6647D03, 0x06BD33AD, 0xD717C795,
- 0xE07E2D67, 0x2688D40B, 0xE23E349F, 0x8C7F559E, 0x3BA698C2, 0xEB5FCD3C,
- 0xE94E2DE5, 0x3C0FE4DF, 0x55454456, 0x12731019, 0x21AF58D7, 0x2555CE03,
- 0x17BBC647, 0xF0C66012, 0xE02D87F8, 0x340DB0CE, 0x72A3766F, 0xE2724C51,
- 0x3636A5FD, 0xC226C419, 0x1A5F0464, 0xA543817B, 0x0B850A8D, 0xD5A6F88B,
- 0xCE3715B8, 0xB73918A2, 0x6AC92E61, 0x0FCD43EA, 0xF559EEDE, 0x3482C340,
- 0x447D9924, 0xF95D6EB2, 0xB22E6C6F, 0x935740D2, 0x7C04B228, 0xB90ABD1A,
- 0x8D9D01C9, 0x43B63B2D, 0xE0EBEDAC, 0x7C219604, 0x8479756F, 0xB67355FE,
- 0xA056539B, 0xAF1D5A02, 0x6660BB07, 0xD1A0593C, 0x5AABEF47, 0x73802FC5,
- 0xAADB5251, 0x92556CFF, 0x5BF44BDC, 0x4DC171CF, 0x1EE4E879, 0x516BC896,
- 0xCDBB21EA, 0xF513BD04, 0x94267720, 0x6B29DAC1, 0x1D778D67, 0x9625EA42,
- 0x23946BBC, 0xF23D2E0A, 0x001C2CFB, 0xEF121203, 0x963A0C2B, 0x1AAE960B,
- 0x13F2D588, 0xAE6BFEAE, 0x77424AC8, 0x1E0B2A9F, 0x9074C626, 0x9BCDE764,
- 0xF8539561, 0xC14A5B05, 0xD88D9FAE, 0x2C5C4C67, 0x2C63BAE5, 0x99CCF4CB,
- 0x3563CA53, 0x0CE7A114, 0xCB8938D3, 0x7C61537F, 0xE717A35E, 0xB69D3832,
- 0xE47931C3, 0xD5C9D409, 0x355E0B97, 0xC60EB27E, 0xB17978F6, 0x77CCBCEA,
- 0x85AEFA12, 0x59DFA376, 0x36DB61D2, 0x96832915, 0xCC4411F3, 0xB81F1EF9,
- 0x2C54E5E1, 0xDD3CE944, 0x02D92E29, 0x1D4795B1, 0x27F900B0, 0x97A516CC,
- 0xA2DB2CC8, 0x3125B863, 0xBF44DC77, 0x211A0226, 0x3A98AB5F, 0x2612396E,
- 0xA1BEF080, 0x708B7433, 0x5D457230, 0xED03C4EB, 0xA84D73AE, 0x89D5582D,
- 0x95F0C7FA, 0xEF51B8C9, 0xF9DCA97D, 0xCB2E49FD, 0xC12B4ADD, 0x611C9AD5,
- 0x35D1D7CE, 0xA77E13BE, 0x207C1B88, 0x0AC289D4, 0x4B553B81, 0x4940991A,
- 0x23D9F9D5, 0xDFD93925, 0xB924E9D2, 0xBFA61D10, 0x861FDF0F, 0xBBD30811,
- 0x953CE5DA, 0x92B48334, 0x5E5B44FC, 0x5B949533, 0x31A5D165, 0x99339641,
- 0x2737671F, 0x512EB25C, 0x54408346, 0xA090A7FE, 0x1D9CA5F9, 0x470C19E4,
- 0x720F936E, 0xA8628453, 0x364D29CC, 0x42E472DF, 0x54949196, 0x6C7C46EA,
- 0x12797418, 0x7D775295, 0xC46A7C32, 0x69CE8560
- }};
-
-#endif /* _CRYPT_KEY_OUTPUT_H */
View
1,075 src/libpiano/piano.c
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2008-2011
+Copyright (c) 2008-2012
Lars-Dominik Braun <lars@6xq.net>
Permission is hereby granted, free of charge, to any person obtaining a copy
@@ -29,40 +29,39 @@ THE SOFTWARE.
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
-#include <time.h>
#include <assert.h>
#include <stdint.h>
-/* needed for urlencode */
-#include <waitress.h>
-
#include "piano_private.h"
#include "piano.h"
-#include "xml.h"
-#include "crypt.h"
#include "config.h"